LightAutoML project from Sberbank AI Lab AutoML group is the framework for automatic classification and regression model creation.
Current available tasks to solve:
- binary classification
- multiclass classification
- regression
Currently we work with datasets, where each row is an object with its specific features and target. Multitable datasets and sequences are now under contruction :)
Note: for automatic creation of interpretable models we use AutoWoE
library made by our group as well.
Authors: Alexander Ryzhkov, Anton Vakhrushev, Dmitry Simakov, Vasilii Bunakov, Rinchin Damdinov, Pavel Shvets, Alexander Kirilin
LightAutoML video guides:
- (Russian) LightAutoML webinar for Sberloga community (Alexander Ryzhkov, Dmitry Simakov)
- (Russian) LightAutoML hands-on tutorial in Kaggle Kernels (Alexander Ryzhkov)
- (English) Automated Machine Learning with LightAutoML: theory and practice (Alexander Ryzhkov)
- (English) LightAutoML framework general overview, benchmarks and advantages for business (Alexander Ryzhkov)
- (English) LightAutoML practical guide - ML pipeline presets overview (Dmitry Simakov)
Articles about LightAutoML:
- (English) LightAutoML vs Titanic: 80% accuracy in several lines of code (Medium)
- (English) Hands-On Python Guide to LightAutoML – An Automatic ML Model Creation Framework (Analytic Indian Mag)
See the Documentation of LightAutoML.
To install LAMA framework on your machine:
pip install -U lightautoml
If you want to create a specific virtual environment for LAMA, you need to install python3-venv
system package and run the following command, which creates lama_venv
virtual env with LAMA inside:
bash build_package.sh
To check this variant of installation and run all the demo scripts, use the command below:
bash test_package.sh
To install optional support for generating reports in pdf format run following commands:
# MacOS
brew install cairo pango gdk-pixbuf libffi
# Debian / Ubuntu
sudo apt-get install build-essential libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev shared-mime-info
# Fedora
sudo yum install redhat-rpm-config libffi-devel cairo pango gdk-pixbuf2
# Windows
# follow this tutorial https://weasyprint.readthedocs.io/en/stable/install.html#windows
poetry install -E pdf
To generate documentation for LAMA framework, you can use command below (it uses virtual env created on installation step from sources):
bash build_docs.sh
Builded official documentation for LightAutoML is available here
.
To find out how to work with LightAutoML, we have several tutorials
. You can run them in Google Colab:
Tutorial_1. Create your own pipeline.ipynb
- shows how to create your own pipeline from specified blocks: pipelines for feature generation and feature selection, ML algorithms, hyperparameter optimization etc.Tutorial_2. AutoML pipeline preset.ipynb
- shows how to use LightAutoML presets (both standalone and time utilized variants) for solving ML tasks on tabular data. Using presets you can solve binary classification, multiclass classification and regression tasks, changing the first argument in Task.Tutorial_3. Multiclass task.ipynb
- shows how to build ML pipeline for multiclass ML task by handTutorial_4. SQL data source for pipeline preset.ipynb
- shows how to use LightAutoML presets (both standalone and time utilized variants) for solving ML tasks on tabular data from SQL data base instead of CSV.Tutorial_5. Uplift modeling.ipynb
- shows how to use LightAutoML for a uplift-modeling task.
Each tutorial has the step to enable Profiler and completes with Profiler run, which generates distribution for each function call time and shows it in interactive HTML report: the report show full time of run on its top and interactive tree of calls with percent of total time spent by the specific subtree (except Tutorial_4
).
Important 1: for production you have no need to use profiler (which increase work time and memory consomption), so please do not turn it on - it is in off state by default
Important 2: to take a look at this report after the run, please comment last line of demo with report deletion command.
Kaggle kernel examples of LightAutoML usage:
- Tabular Playground Series April 2021 competition solution
- Titanic competition solution (80% accuracy)
- Titanic 12-code-lines competition solution (78% accuracy)
- House prices competition solution
- Natural Language Processing with Disaster Tweets solution
- Tabular Playground Series March 2021 competition solution
- Tabular Playground Series February 2021 competition solution
- Interpretable WhiteBox solution
- Custom ML pipeline elements inside existing ones
For more examples, in tests
folder you can find different scenarios of LightAutoML usage:
demo0.py
- building ML pipeline from blocks and fit + predict the pipeline itself.demo1.py
- several ML pipelines creation (using importances based cutoff feature selector) to build 2 level stacking using AutoML classdemo2.py
- several ML pipelines creation (using iteartive feature selection algorithm) to build 2 level stacking using AutoML classdemo3.py
- several ML pipelines creation (using combination of cutoff and iterative FS algos) to build 2 level stacking using AutoML classdemo4.py
- creation of classification and regression tasks for AutoML with loss and evaluation metric setupdemo5.py
- 2 level stacking using AutoML class with different algos on first level including LGBM, Linear and LinearL1demo6.py
- AutoML with nested CV usagedemo7.py
- AutoML preset usage for tabular datasets (predefined structure of AutoML pipeline and simple interface for users without building from blocks)demo8.py
- creation pipelines from blocks to build AutoML, solving multiclass classification taskdemo9.py
- AutoML time utilization preset usage for tabular datasets (predefined structure of AutoML pipeline and simple interface for users without building from blocks)demo10.py
- creation pipelines from blocks (including CatBoost) to build AutoML, solving multiclass classification taskdemo11.py
- AutoML NLP preset usage for tabular datasets with text columnsdemo12.py
- AutoML tabular preset usage with custom validation scheme and multiprocessed inference
If you are interested in contributing to LightAutoML, please read the Contributing Guide to get started.
Write a message to us:
- Alexander Ryzhkov (email: AMRyzhkov@sberbank.ru, telegram: @RyzhkovAlex)
- Anton Vakhrushev (email: AGVakhrushev@sberbank.ru)
- Dmitry Simakov (email: Simakov.D.E@sberbank.ru)