Skip to content

Commit

Permalink
updated version to v0.1.0 (open-mmlab#906)
Browse files Browse the repository at this point in the history
* updated version to v0.1.0
* updated project description
* capped python version to <3.8, added classifiers and project_urls to setup.py
* Removed hard dependency on mxnet for autogluon.core and autogluon.tabular
* Removed gluoncv dependency in Tabular
  • Loading branch information
Innixma authored Feb 7, 2021
1 parent 7a9b583 commit 14f8894
Show file tree
Hide file tree
Showing 21 changed files with 282 additions and 84 deletions.
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
AutoML Toolkit with MXNet Gluon
AutoML for Text, Image, and Tabular Data
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.16
0.1.0
42 changes: 34 additions & 8 deletions autogluon/setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#!/usr/bin/env python
import os
import shutil
import subprocess
import codecs
import os.path

from setuptools import setup, find_packages, find_namespace_packages
from setuptools import setup, find_packages

cwd = os.path.dirname(os.path.abspath(__file__))

Expand Down Expand Up @@ -46,7 +43,7 @@ def create_version_file():

long_description = open(os.path.join('..', 'README.md')).read()

MIN_PYTHON_VERSION = '>=3.6.*'
python_requires = '>=3.6, <3.8'

requirements = [
f'autogluon.core=={version}',
Expand All @@ -70,10 +67,10 @@ def create_version_file():
version=version,
author='AutoGluon Community',
url='https://github.com/awslabs/autogluon',
description='AutoML Toolkit with MXNet Gluon',
description='AutoML for Text, Image, and Tabular Data',
long_description=long_description,
long_description_content_type='text/markdown',
license='Apache',
license='Apache-2.0',

# Package info
packages=find_packages('src'),
Expand All @@ -82,10 +79,39 @@ def create_version_file():
zip_safe=True,
include_package_data=True,
install_requires=requirements + test_requirements,
python_requires=MIN_PYTHON_VERSION,
python_requires=python_requires,
package_data={'autogluon': [
'LICENSE',
]},
entry_points={
},
# TODO: Move classifiers / project_urls / other arguments to a shared file across all submodules?
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Education",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Intended Audience :: Customer Service",
"Intended Audience :: Financial and Insurance Industry",
"Intended Audience :: Healthcare Industry",
"Intended Audience :: Telecommunications Industry",
"License :: OSI Approved :: Apache Software License",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
'Programming Language :: Python :: 3',
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Software Development",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Scientific/Engineering :: Image Recognition",
],
project_urls={
'Documentation': 'https://auto.gluon.ai',
'Bug Reports': 'https://github.com/awslabs/autogluon/issues',
'Source': 'https://github.com/awslabs/autogluon/',
'Contribute!': 'https://github.com/awslabs/autogluon/blob/master/CONTRIBUTING.md',
},
)
8 changes: 4 additions & 4 deletions core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def create_version_file():

long_description = open(os.path.join('..', 'README.md')).read()

MIN_PYTHON_VERSION = '>=3.6.*' # TODO v0.1: Also specify max version? (We don't support 3.8)
python_requires = '>=3.6, <3.8'

requirements = [
'numpy>=1.20',
Expand Down Expand Up @@ -75,10 +75,10 @@ def create_version_file():
version=version,
author='AutoGluon Community',
url='https://github.com/awslabs/autogluon',
description='AutoML Toolkit with MXNet Gluon',
description='AutoML for Text, Image, and Tabular Data',
long_description=long_description,
long_description_content_type='text/markdown',
license='Apache',
license='Apache-2.0',

# Package info
packages=find_packages('src'),
Expand All @@ -87,7 +87,7 @@ def create_version_file():
zip_safe=True,
include_package_data=True,
install_requires=requirements + test_requirements,
python_requires=MIN_PYTHON_VERSION,
python_requires=python_requires,
package_data={'autogluon': [
'LICENSE',
]},
Expand Down
11 changes: 4 additions & 7 deletions core/src/autogluon/core/metrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import scipy.stats
import sklearn.metrics

from . import classification_metrics, softclass_metrics
from . import classification_metrics
from .util import sanitize_array
from ..constants import PROBLEM_TYPES, PROBLEM_TYPES_REGRESSION, PROBLEM_TYPES_CLASSIFICATION
from ..utils.miscs import warning_filter
Expand Down Expand Up @@ -405,10 +405,6 @@ def customized_log_loss(y_true, y_pred, eps=1e-15):
greater_is_better=True,
needs_proba=True)

# Score for soft-classification (with soft, probabilistic labels):
soft_log_loss = make_scorer('soft_log_loss', softclass_metrics.soft_log_loss,
greater_is_better=False, needs_proba=True)

REGRESSION_METRICS = dict()
for scorer in [r2, mean_squared_error, root_mean_squared_error, mean_absolute_error,
median_absolute_error, spearmanr, pearsonr]:
Expand Down Expand Up @@ -495,8 +491,7 @@ def calculate_score(solution, prediction, task_type, metric,
def get_metric(metric, problem_type=None, metric_type=None) -> Scorer:
"""Returns metric function by using its name if the metric is str.
Performs basic check for metric compatibility with given problem type."""
all_available_metric_names = list(CLASSIFICATION_METRICS.keys())\
+ list(REGRESSION_METRICS.keys()) + [soft_log_loss]
all_available_metric_names = list(CLASSIFICATION_METRICS.keys()) + list(REGRESSION_METRICS.keys()) + ['soft_log_loss']
if metric is not None and isinstance(metric, str):
if metric in CLASSIFICATION_METRICS:
if problem_type is not None and problem_type not in PROBLEM_TYPES_CLASSIFICATION:
Expand All @@ -507,6 +502,8 @@ def get_metric(metric, problem_type=None, metric_type=None) -> Scorer:
raise ValueError(f"{metric_type}={metric} can only be used for regression problems")
return REGRESSION_METRICS[metric]
elif metric == 'soft_log_loss':
# Requires mxnet
from .softclass_metrics import soft_log_loss
return soft_log_loss
else:
raise ValueError(
Expand Down
14 changes: 12 additions & 2 deletions core/src/autogluon/core/metrics/softclass_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

import logging

import mxnet as mx
import numpy as np

from . import make_scorer
from ..utils.try_import import try_import_mxnet

try_import_mxnet()
import mxnet as mx

logger = logging.getLogger(__name__)

EPS = 1e-10 # clipping threshold to prevent NaN
Expand All @@ -13,7 +18,7 @@
softloss = mx.gluon.loss.SoftmaxCrossEntropyLoss(sparse_label=False, from_logits=True)


def soft_log_loss(true_probs, predicted_probs):
def _soft_log_loss(true_probs, predicted_probs):
""" Both args must be 2D pandas/numpy arrays """
true_probs = np.array(true_probs)
predicted_probs = np.array(predicted_probs)
Expand All @@ -28,3 +33,8 @@ def soft_log_loss(true_probs, predicted_probs):
predicted_probs = predicted_probs / predicted_probs.sum(axis=1, keepdims=1)
losses = softloss(mx.nd.log(mx.nd.array(predicted_probs)), mx.nd.array(true_probs))
return mx.nd.mean(losses).asscalar()


# Score for soft-classification (with soft, probabilistic labels):
soft_log_loss = make_scorer('soft_log_loss', _soft_log_loss,
greater_is_better=False, needs_proba=True)
2 changes: 1 addition & 1 deletion docs/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ author = AutoGluon contributors

copyright = 2019, All developers. Licensed under the Apache License, Version 2.0.

release = 0.0.16
release = 0.1.0

[html]

Expand Down
2 changes: 1 addition & 1 deletion docs/root_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">

<title>AutoGluon: AutoML Toolkit for Deep Learning &#8212; AutoGluon Documentation</title>
<title>AutoGluon: AutoML for Text, Image, and Tabular Data &#8212; AutoGluon Documentation</title>

<link rel="stylesheet" href="_static/basic.css" type="text/css"/>
<link rel="stylesheet" href="_static/pygments.css" type="text/css"/>
Expand Down
2 changes: 1 addition & 1 deletion docs/versions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Available Documentation for AutoGluon

Web-based documentation is available for versions listed below:

- `AutoGluon 0.0.16 (dev) documentation <https://auto.gluon.ai/dev/index.html>`_
- `AutoGluon 0.1.0 (dev) documentation <https://auto.gluon.ai/dev/index.html>`_
- `AutoGluon 0.0.15 (stable) documentation <https://auto.gluon.ai/stable/index.html>`_
8 changes: 4 additions & 4 deletions extra/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def create_version_file():

long_description = open(os.path.join('..', 'README.md')).read()

MIN_PYTHON_VERSION = '>=3.6.*'
python_requires = '>=3.6, <3.8'

requirements = [
'numpy>=1.20',
Expand All @@ -68,10 +68,10 @@ def create_version_file():
version=version,
author='AutoGluon Community',
url='https://github.com/awslabs/autogluon',
description='AutoML Toolkit with MXNet Gluon',
description='AutoML for Text, Image, and Tabular Data',
long_description=long_description,
long_description_content_type='text/markdown',
license='Apache',
license='Apache-2.0',

# Package info
packages=find_packages('src'),
Expand All @@ -80,7 +80,7 @@ def create_version_file():
zip_safe=True,
include_package_data=True,
install_requires=requirements + test_requirements,
python_requires=MIN_PYTHON_VERSION,
python_requires=python_requires,
package_data={'autogluon': [
'LICENSE',
]},
Expand Down
8 changes: 4 additions & 4 deletions features/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def create_version_file():

long_description = open(os.path.join('..', 'README.md')).read()

MIN_PYTHON_VERSION = '>=3.6.*'
python_requires = '>=3.6, <3.8'

requirements = [
'numpy>=1.20',
Expand All @@ -61,10 +61,10 @@ def create_version_file():
version=version,
author='AutoGluon Community',
url='https://github.com/awslabs/autogluon',
description='AutoML Toolkit with MXNet Gluon',
description='AutoML for Text, Image, and Tabular Data',
long_description=long_description,
long_description_content_type='text/markdown',
license='Apache',
license='Apache-2.0',

# Package info
packages=find_packages('src'),
Expand All @@ -73,7 +73,7 @@ def create_version_file():
zip_safe=True,
include_package_data=True,
install_requires=requirements + test_requirements,
python_requires=MIN_PYTHON_VERSION,
python_requires=python_requires,
package_data={'autogluon': [
'LICENSE',
]},
Expand Down
8 changes: 4 additions & 4 deletions mxnet/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def create_version_file():

long_description = open(os.path.join('..', 'README.md')).read()

MIN_PYTHON_VERSION = '>=3.6.*'
python_requires = '>=3.6, <3.8'

requirements = [
'Pillow<=6.2.1',
Expand All @@ -64,10 +64,10 @@ def create_version_file():
version=version,
author='AutoGluon Community',
url='https://github.com/awslabs/autogluon',
description='AutoML Toolkit with MXNet Gluon',
description='AutoML for Text, Image, and Tabular Data',
long_description=long_description,
long_description_content_type='text/markdown',
license='Apache',
license='Apache-2.0',

# Package info
packages=find_packages('src'),
Expand All @@ -76,7 +76,7 @@ def create_version_file():
zip_safe=True,
include_package_data=True,
install_requires=requirements + test_requirements,
python_requires=MIN_PYTHON_VERSION,
python_requires=python_requires,
package_data={'autogluon': [
'LICENSE',
]},
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[pycodestyle]
max_line_length = 120
max_line_length = 160


[flake8]
max-line-length = 120
max-line-length = 160
9 changes: 4 additions & 5 deletions tabular/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def create_version_file():

long_description = open(os.path.join('..', 'README.md')).read()

MIN_PYTHON_VERSION = '>=3.6.*'
python_requires = '>=3.6, <3.8'

requirements = [
'numpy>=1.20',
Expand All @@ -52,7 +52,6 @@ def create_version_file():
'psutil>=5.0.0,<=5.7.0', # TODO: psutil 5.7.1/5.7.2 has non-deterministic error on CI doc build - ImportError: cannot import name '_psutil_linux' from 'psutil'
'scikit-learn>=0.22.0,<0.24',
'networkx>=2.3,<3.0',
'gluoncv>=0.9.1,<1.0', # TODO: v0.1 consider using only minimum required code from gluoncv and drop dependency
'torch>=1.0,<2.0', # TODO: v0.1 make optional
'fastai>=1.0,<2.0', # TODO: v0.1 make optional
f'autogluon.core=={version}',
Expand All @@ -71,10 +70,10 @@ def create_version_file():
version=version,
author='AutoGluon Community',
url='https://github.com/awslabs/autogluon',
description='AutoML Toolkit with MXNet Gluon',
description='AutoML for Text, Image, and Tabular Data',
long_description=long_description,
long_description_content_type='text/markdown',
license='Apache',
license='Apache-2.0',

# Package info
packages=find_packages('src'),
Expand All @@ -83,7 +82,7 @@ def create_version_file():
zip_safe=True,
include_package_data=True,
install_requires=requirements + test_requirements,
python_requires=MIN_PYTHON_VERSION,
python_requires=python_requires,
package_data={'autogluon': [
'LICENSE',
]},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import math
import numpy as np

from autogluon.core.metrics import soft_log_loss
from autogluon.core.metrics.softclass_metrics import soft_log_loss
from autogluon.core.utils import try_import_catboost, try_import_catboostdev

from .catboost_utils import CustomMetric
Expand Down
Loading

0 comments on commit 14f8894

Please sign in to comment.