Skip to content

Port over to AutoML common #1318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Dec 2, 2021
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ea234ab
Add submodule
eddiebergman Nov 22, 2021
eece33b
Port to abstract_ensemble, backend from automl_common
eddiebergman Nov 23, 2021
51fac24
Updated workflow files
eddiebergman Nov 23, 2021
0cd071b
Update imports
eddiebergman Nov 23, 2021
e4fae7b
Trigger actions
eddiebergman Nov 23, 2021
cd73bdd
Another import fix
eddiebergman Nov 23, 2021
915644a
update import
eddiebergman Nov 23, 2021
8beb4c0
m
eddiebergman Nov 23, 2021
08e649a
Backend fixes
eddiebergman Nov 25, 2021
e7a1cfa
Backend parameter update
eddiebergman Nov 25, 2021
7e09437
fixture fix for backend
eddiebergman Nov 25, 2021
8fc2d47
Fix tests
eddiebergman Nov 27, 2021
c9b055a
readd old abstract ensemble for now
eddiebergman Nov 27, 2021
74b926c
flake8'd
eddiebergman Nov 27, 2021
eda539e
Added install from source to readme
eddiebergman Nov 29, 2021
543feac
Moved installation w.r.t submodules to the docs
eddiebergman Dec 1, 2021
8f373f0
Temporarily remove submodule
eddiebergman Dec 1, 2021
a0140aa
Readded submodule
eddiebergman Dec 1, 2021
151f613
Updated to use automl_common under autosklearn
eddiebergman Dec 1, 2021
7e564d5
Updated MANIFEST
eddiebergman Dec 1, 2021
3528aef
Removed uneeded statements from MANIFEST
eddiebergman Dec 1, 2021
5cbc6e5
Fixed import
eddiebergman Dec 1, 2021
1c5d5d9
Fixed comment line in MANIFEST.in
eddiebergman Dec 1, 2021
e66ba80
Added automl_common/setup.py to MANIFEST
eddiebergman Dec 2, 2021
d4f0884
Added prefix to script
eddiebergman Dec 2, 2021
5a7d9be
Re-added removed title #
eddiebergman Dec 2, 2021
2054887
Added note for submodule for CONTRIBUTING
eddiebergman Dec 2, 2021
036150c
Made the submodule step a bit more clear for contributing.md
eddiebergman Dec 2, 2021
0a40223
CONTRIBUTING fixes
eddiebergman Dec 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,34 @@ on: [push, pull_request]
jobs:
dist:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Check out the repo
uses: actions/checkout@v2
with:
submodules: recursive

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Build dist
run: |
python setup.py sdist

- name: Twine check
run: |
pip install twine
last_dist=$(ls -t dist/auto-sklearn-*.tar.gz | head -n 1)
twine_output=`twine check "$last_dist"`
if [[ "$twine_output" != "Checking $last_dist: PASSED" ]]; then echo $twine_output && exit 1;fi

- name: Install dist
run: |
last_dist=$(ls -t dist/auto-sklearn-*.tar.gz | head -n 1)
pip install $last_dist

- name: PEP 561 Compliance
run: |
pip install mypy
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest

steps:
- name: Check out the repo
uses: actions/checkout@v2
with:
submodules: recursive

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: Push to GitHub Packages
uses: docker/build-push-action@v1
with:
Expand All @@ -28,26 +33,32 @@ jobs:
repository: automl/auto-sklearn/auto-sklearn
tag_with_ref: true
tags: ${{ steps.extract_branch.outputs.branch }}

- name: Push to Docker Hub
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: mfeurer/auto-sklearn
tags: ${{ steps.extract_branch.outputs.branch }}

- name: Docker Login
run: docker login docker.pkg.github.com -u $GITHUB_ACTOR -p $GITHUB_TOKEN
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Pull Docker image
run: docker pull docker.pkg.github.com/$GITHUB_REPOSITORY/auto-sklearn:$BRANCH
env:
BRANCH: ${{ steps.extract_branch.outputs.branch }}

- name: Run image
run: docker run -i -d --name unittester -v $GITHUB_WORKSPACE:/workspace -w /workspace docker.pkg.github.com/$GITHUB_REPOSITORY/auto-sklearn:$BRANCH
env:
BRANCH: ${{ steps.extract_branch.outputs.branch }}

- name: Auto-Sklearn loaded
run: docker exec -i unittester python3 -c 'import autosklearn; print(f"Auto-sklearn imported from {autosklearn.__file__}")'

- name: Run unit testing
run: docker exec -i unittester python3 -m pytest -v test
11 changes: 10 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,42 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
pip install -e .[docs,examples,examples_unix]
pip install -e .[docs,examples]

- name: Make docs
run: |
cd doc
make html

- name: Check links
run: |
cd doc
make linkcheck

- name: Pull latest gh-pages
if: (contains(github.ref, 'develop') || contains(github.ref, 'master')) && github.event_name == 'push'
run: |
cd ..
git clone https://github.com/automl/auto-sklearn.git --branch gh-pages --single-branch gh-pages

- name: Copy new doc into gh-pages
if: (contains(github.ref, 'develop') || contains(github.ref, 'master')) && github.event_name == 'push'
run: |
branch_name=${GITHUB_REF##*/}
cd ../gh-pages
rm -rf $branch_name
cp -r ../auto-sklearn/doc/build/html $branch_name

- name: Push to gh-pages
if: (contains(github.ref, 'develop') || contains(github.ref, 'master')) && github.event_name == 'push'
run: |
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Setup Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install pre-commit
run: |
pip install pre-commit
pre-commit install

- name: Run pre-commit
run: |
pre-commit run --all-files
3 changes: 3 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
steps:

- uses: actions/checkout@v2
with:
submodules: recursive

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
# A note on checkout: When checking out the repository that
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "autosklearn/automl_common"]
path = autosklearn/automl_common
url = https://github.com/automl/automl_common
13 changes: 11 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,20 @@ Following that we'll tell you about how you can test your changes locally and th
It's important to work off the latest changes on the **development** branch.
```bash
# With https
git clone https://github.com/your-username/auto-sklearn
# Note the --recurse-submodules args, we use a submodule autosklearn/automl_common
# so it needs to be downloaded too
git clone --recurse-submodules https://github.com/your-username/auto-sklearn

# ... or with ssh
git clone [email protected]:your-username/auto-sklearn.git
git clone --recurse-submodules [email protected]:your-username/auto-sklearn.git

# Navigate into the cloned repo
cd auto-sklearn

# Create a new branch based off the development one
git checkout -b my_new_branch development

git submodule udate --init --recursive # If you missed the --recurse-submodules arg

# ... Alternatively, if you would prefer a more manual method
# Show all the available branches with a * beside your current one
Expand All @@ -50,6 +54,8 @@ Following that we'll tell you about how you can test your changes locally and th

# Create a new branch based on the currently active branch
git checkout -b my_new_branch

git submodule udate --init --recursive # If you missed the --recurse-submodules arg
```

The reason to create a new branch is two fold:
Expand Down Expand Up @@ -335,6 +341,9 @@ Lastly, if the feature really is a game changer or you're very proud of it, cons
cd auto-sklearn
git checkout -b my_new_branch development

# Initaize autosklearn/automl_common submodule
git submodule update --init --recursive

# Create a virtual environment and activate it so there are no package
# conflicts
python -m venv my-virtual-env
Expand Down
22 changes: 15 additions & 7 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
recursive-include autosklearn/metalearning/files *.arff
recursive-include autosklearn/metalearning/files *.csv
recursive-include autosklearn/metalearning/files *.txt
include autosklearn/util/logging.yaml
include LICENSE.txt
include requirements.txt
include autosklearn/util/logging.yaml
include autosklearn/requirements.txt
recursive-include autosklearn/experimental/ *.json
include autosklearn/experimental/askl2_training_data.json
include LICENSE.txt

# Meta-data
recursive-include autosklearn/metalearning/files *.arff *.csv *.txt
recursive-include autosklearn/experimental *.json

# Remove tests from automl_common
prune autosklearn/automl_common/test
exclude autosklearn/automl_common/setup.py

# Include automl_common LICENSE and README
include autosklearn/automl_common/LICENSE
include autosklearn/automl_common/README.md

5 changes: 4 additions & 1 deletion autosklearn/automl.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
from sklearn.metrics._classification import type_of_target
from sklearn.dummy import DummyClassifier, DummyRegressor

from autosklearn.automl_common.common.utils.backend import Backend, create

from autosklearn.metrics import Scorer, default_metric_for_task
from autosklearn.data.xy_data_manager import XYDataManager
from autosklearn.data.validation import (
Expand All @@ -49,7 +51,6 @@
from autosklearn.evaluation.abstract_evaluator import _fit_and_suppress_warnings
from autosklearn.evaluation.train_evaluator import TrainEvaluator, _fit_with_budget
from autosklearn.metrics import calculate_metric
from autosklearn.util.backend import Backend, create
from autosklearn.util.stopwatch import StopWatch
from autosklearn.util.logging_ import (
setup_logger,
Expand Down Expand Up @@ -280,6 +281,8 @@ def __init__(self,
def _create_backend(self) -> Backend:
return create(
temporary_directory=self._temporary_directory,
output_directory=None,
prefix="auto-sklearn",
delete_tmp_folder_after_terminate=self._delete_tmp_folder_after_terminate,
)

Expand Down
1 change: 1 addition & 0 deletions autosklearn/automl_common
Submodule automl_common added at 4c8ab9
5 changes: 3 additions & 2 deletions autosklearn/ensemble_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
from smac.runhistory.runhistory import RunInfo, RunValue
from smac.tae.base import StatusType

from autosklearn.util.backend import Backend
from autosklearn.automl_common.common.utils.backend import Backend
from autosklearn.automl_common.common.ensemble_building.abstract_ensemble import AbstractEnsemble

from autosklearn.constants import BINARY_CLASSIFICATION
from autosklearn.metrics import calculate_score, calculate_loss, Scorer
from autosklearn.ensembles.ensemble_selection import EnsembleSelection
from autosklearn.ensembles.abstract_ensemble import AbstractEnsemble
from autosklearn.util.logging_ import get_named_client_logger
from autosklearn.util.parallel import preload_modules

Expand Down
2 changes: 1 addition & 1 deletion autosklearn/ensembles/singlebest_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

from smac.runhistory.runhistory import RunHistory

from autosklearn.automl_common.common.utils.backend import Backend
from autosklearn.ensembles.abstract_ensemble import AbstractEnsemble
from autosklearn.metrics import Scorer
from autosklearn.pipeline.base import BasePipeline
from autosklearn.util.backend import Backend


class SingleBest(AbstractEnsemble):
Expand Down
5 changes: 3 additions & 2 deletions autosklearn/evaluation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@

from sklearn.model_selection._split import _RepeatedSplits, BaseShuffleSplit,\
BaseCrossValidator
from autosklearn.metrics import Scorer

from autosklearn.automl_common.common.utils.backend import Backend

from autosklearn.metrics import Scorer
import autosklearn.evaluation.train_evaluator
import autosklearn.evaluation.test_evaluator
import autosklearn.evaluation.util
import autosklearn.pipeline.components
from autosklearn.evaluation.train_evaluator import TYPE_ADDITIONAL_INFO
from autosklearn.util.backend import Backend
from autosklearn.util.logging_ import PickableLoggerAdapter, get_named_client_logger
from autosklearn.util.parallel import preload_modules

Expand Down
3 changes: 2 additions & 1 deletion autosklearn/evaluation/abstract_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

from threadpoolctl import threadpool_limits

from autosklearn.automl_common.common.utils.backend import Backend

import autosklearn.pipeline.classification
import autosklearn.pipeline.regression
from autosklearn.pipeline.components.base import ThirdPartyComponents, _addons
Expand All @@ -28,7 +30,6 @@
convert_multioutput_multiclass_to_multilabel
)
from autosklearn.metrics import calculate_loss, Scorer
from autosklearn.util.backend import Backend
from autosklearn.util.logging_ import PicklableClientLogger, get_named_client_logger

from ConfigSpace import Configuration
Expand Down
3 changes: 2 additions & 1 deletion autosklearn/evaluation/test_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@

from smac.tae import StatusType

from autosklearn.automl_common.common.utils.backend import Backend

from autosklearn.evaluation.abstract_evaluator import (
AbstractEvaluator,
_fit_and_suppress_warnings,
)
from autosklearn.pipeline.components.base import ThirdPartyComponents
from autosklearn.metrics import calculate_loss, Scorer
from autosklearn.util.backend import Backend


__all__ = [
Expand Down
3 changes: 2 additions & 1 deletion autosklearn/evaluation/train_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
StratifiedKFold, train_test_split, BaseCrossValidator, PredefinedSplit
from sklearn.model_selection._split import _RepeatedSplits, BaseShuffleSplit

from autosklearn.automl_common.common.utils.backend import Backend

from autosklearn.evaluation.abstract_evaluator import (
AbstractEvaluator,
TYPE_ADDITIONAL_INFO,
Expand All @@ -37,7 +39,6 @@
from autosklearn.pipeline.base import PIPELINE_DATA_DTYPE
from autosklearn.pipeline.components.base import IterativeComponent, ThirdPartyComponents
from autosklearn.metrics import Scorer
from autosklearn.util.backend import Backend
from autosklearn.util.logging_ import PicklableClientLogger


Expand Down
Loading