Git Product home page Git Product logo

deeppipe's Introduction

DeepPipe: Deep Pipeline Embeddings for AutoML

DeepPipe efficiently optimizes Machine Learning Pipelines using meta-learning. For detailed information, refer to our paper Deep Pipeline Embeddings for AutoML accepted at KDD 2023. Additionally, you can visit our blog-post to have a friendly insight on how our method works.

DeepPipe Architecture

Installation

We present an API for optimizing pipelines in scikit-learn based on the TensorOboe search space. You can use it to search for accurate pipelines or for benchmarking your Machine Learning model on tabular data.

conda create -n deeppipe_env python==3.9
conda activate deeppipe_env
pip install deeppipe_api==0.1.4

Getting started

We present an example using an OpenML dataset. However, it works with any tabular data typed as pandas dataframe.

from deeppipe_api.deeppipe import load_data, openml, DeepPipe

task_id = 37
task = openml.tasks.get_task(task_id)
X_train, X_test, y_train, y_test = load_data(task, fold=0)
deep_pipe = DeepPipe(n_iters = 50,  #bo iterations
                    time_limit = 3600 #in seconds
                    )
deep_pipe.fit(X_train, y_train)
y_pred = deep_pipe.predict(X_test)

#Test
score = deep_pipe.score(X_test, y_test)
print("Test acc.:", score)

#print best pipeline
print(deep_pipe.model)

Note: When comparing with other AutoML optimizers have in mind that the search space might differ.

Ensemble of Pipelines

It is possible to ensemble the best pipelines, by using a greedy approach.

from deeppipe_api.deeppipe import load_data, openml, DeepPipe

task = openml.tasks.get_task(task_id=37)
X_train, X_test, y_train, y_test = load_data(task, fold=0)
deep_pipe = DeepPipe(n_iters = 50,  #bo iterations
                    time_limit = 3600, #in seconds
                    create_ensemble = False,
                    ensemble_size = 10,
                    )
deep_pipe.fit(X_train, y_train)
y_pred = deep_pipe.predict(X_test)
score = deep_pipe.score(X_test, y_test)
print("Test acc.:", score) 

Collab Notebook

You can try running DeepPipe in this colab notebook.

Advanced Usage

For meta-training DeepPipe or testing other search spaces, you can refer to the folder src/deeppipe_api/experiments/.

Our Paper

If you use this repository/package, please cite our paper:

@inproceedings{pineda2023_deeppipe,
author = {Pineda Arango, Sebastian and Grabocka, Josif},
title = {Deep Pipeline Embeddings for AutoML},
year = {2023},
isbn = {9798400701030},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3580305.3599303},
doi = {10.1145/3580305.3599303}
booktitle = {Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
pages = {1907–1919},
numpages = {13},
location = {Long Beach, CA, USA},
series = {KDD '23}
}

deeppipe's People

Contributors

sebastianpinedaar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

deeppipe's Issues

Can't install on Google Colab

Hi! Please, how can DeepPipe be installed on Colab?
I tried pip install deeppipe_api but resulted in error. Thanks!

Collecting deeppipe_api
  Downloading deeppipe_api-0.1.1-py3-none-any.whl (51.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 51.3/51.3 MB 7.0 MB/s eta 0:00:00
Collecting gpytorch==1.4.2 (from deeppipe_api)
  Downloading gpytorch-1.4.2-py2.py3-none-any.whl (492 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 492.5/492.5 kB 46.8 MB/s eta 0:00:00
Collecting numpy==1.20.3 (from deeppipe_api)
  Downloading numpy-1.20.3.zip (7.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.8/7.8 MB 75.9 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting openml==0.12.2 (from deeppipe_api)
  Downloading openml-0.12.2.tar.gz (119 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 119.9/119.9 kB 13.8 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting pandas==1.2.4 (from deeppipe_api)
  Downloading pandas-1.2.4.tar.gz (5.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.5/5.5 MB 72.7 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting protobuf==3.17.3 (from deeppipe_api)
  Downloading protobuf-3.17.3-py2.py3-none-any.whl (173 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 173.9/173.9 kB 17.5 MB/s eta 0:00:00
Requirement already satisfied: scikit-learn==1.2.2 in /usr/local/lib/python3.10/dist-packages (from deeppipe_api) (1.2.2)
Collecting tensorboard==2.5.0 (from deeppipe_api)
  Downloading tensorboard-2.5.0-py3-none-any.whl (6.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.0/6.0 MB 123.7 MB/s eta 0:00:00
Collecting tensorly==0.7.0 (from deeppipe_api)
  Downloading tensorly-0.7.0-py3-none-any.whl (198 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 198.1/198.1 kB 22.4 MB/s eta 0:00:00
INFO: pip is looking at multiple versions of deeppipe-api to determine which version is compatible with other requirements. This could take a while.
Collecting deeppipe_api
  Downloading deeppipe_api-0.1.0-py3-none-any.whl (51.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 51.3/51.3 MB 6.9 MB/s eta 0:00:00
  Downloading deeppipe_api-0.0.14-py3-none-any.whl (51.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 51.3/51.3 MB 6.8 MB/s eta 0:00:00
  Downloading deeppipe_api-0.0.12-py3-none-any.whl (107 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 107.5/107.5 kB 13.1 MB/s eta 0:00:00
  Downloading deeppipe_api-0.0.11-py3-none-any.whl (107 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 107.5/107.5 kB 12.6 MB/s eta 0:00:00
  Downloading deeppipe_api-0.0.10-py3-none-any.whl (107 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 107.4/107.4 kB 13.9 MB/s eta 0:00:00
  Downloading deeppipe_api-0.0.9-py3-none-any.whl (106 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 106.9/106.9 kB 15.1 MB/s eta 0:00:00
  Downloading deeppipe_api-0.0.8-py3-none-any.whl (106 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 106.8/106.8 kB 14.8 MB/s eta 0:00:00
INFO: pip is looking at multiple versions of deeppipe-api to determine which version is compatible with other requirements. This could take a while.
  Downloading deeppipe_api-0.0.7-py3-none-any.whl (106 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 106.8/106.8 kB 13.6 MB/s eta 0:00:00
  Downloading deeppipe_api-0.0.6-py3-none-any.whl (96 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.5/96.5 kB 13.3 MB/s eta 0:00:00
  Downloading deeppipe_api-0.0.5-py3-none-any.whl (96 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.5/96.5 kB 14.0 MB/s eta 0:00:00
  Downloading deeppipe_api-0.0.4-py3-none-any.whl (96 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.3/96.3 kB 11.7 MB/s eta 0:00:00

ERROR: Cannot install deeppipe-api==0.0.10, deeppipe-api==0.0.11, deeppipe-api==0.0.12, deeppipe-api==0.0.14, deeppipe-api==0.0.4, deeppipe-api==0.0.5, deeppipe-api==0.0.6, deeppipe-api==0.0.7, deeppipe-api==0.0.8, deeppipe-api==0.0.9, deeppipe-api==0.1.0 and deeppipe-api==0.1.1 because these package versions have conflicting dependencies.

The conflict is caused by:
    deeppipe-api 0.1.1 depends on torch==1.8.1
    deeppipe-api 0.1.0 depends on torch==1.8.1
    deeppipe-api 0.0.14 depends on torch==1.8.1
    deeppipe-api 0.0.12 depends on torch==1.8.1
    deeppipe-api 0.0.11 depends on torch==1.8.1
    deeppipe-api 0.0.10 depends on torch==1.8.1
    deeppipe-api 0.0.9 depends on torch==1.8.1
    deeppipe-api 0.0.8 depends on torch==1.8.1
    deeppipe-api 0.0.7 depends on torch==1.8.1
    deeppipe-api 0.0.6 depends on torch==1.8.1
    deeppipe-api 0.0.5 depends on torch==1.8.1
    deeppipe-api 0.0.4 depends on torch==1.8.1

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.