Skip to main content

A Python package for fast exploration of machine learning pipelines

Project description

ATOM


Automated Tool for Optimized Modelling

A Python package for fast exploration of machine learning pipelines



Overview

Author: Mavs      Email: m.524687@gmail.com      Documentation: https://tvdboom.github.io/ATOM/

Repository:

Project Status: Active Conda Recipe Python 3.6|3.7|3.8|3.9 License: MIT Conda Platforms

Release info:

PyPI version Conda Version Downloads

Build status:

Build Status Azure Pipelines codecov

Code analysis:

Code style: black Language grade: Python Total alerts



Introduction

During the exploration phase of a machine learning project, a data scientist tries to find the optimal pipeline for his specific use case. This usually involves applying standard data cleaning steps, creating or selecting useful features, trying out different models, etc. Testing multiple pipelines requires many lines of code, and writing it all in the same notebook often makes it long and cluttered. On the other hand, using multiple notebooks makes it harder to compare the results and to keep an overview. On top of that, refactoring the code for every test can be quite time-consuming. How many times have you conducted the same action to pre-process a raw dataset? How many times have you copy-and-pasted code from an old repository to re-use it in a new use case?

ATOM is here to help solve these common issues. The package acts as a wrapper of the whole machine learning pipeline, helping the data scientist to rapidly find a good model for his problem. Avoid endless imports and documentation lookups. Avoid rewriting the same code over and over again. With just a few lines of code, it's now possible to perform basic data cleaning steps, select relevant features and compare the performance of multiple models on a given dataset, providing quick insights on which pipeline performs best for the task at hand.

Example steps taken by ATOM's pipeline:

  1. Data Cleaning
    • Handle missing values
    • Encode categorical features
    • Detect and remove outliers
    • Balance the training set
  2. Feature engineering
    • Create new non-linear features
    • Remove multi-collinear features
    • Remove features with too low variance
    • Select the most promising features
  3. Train and validate multiple models
    • Select hyperparameters using a Bayesian Optimization approach
    • Train and test the models on the provided data
    • Assess the robustness of the output using a bootstrap algorithm
  4. Analyze the results
    • Get the model scores on various metrics
    • Make plots to compare the model performances



diagram_pipeline

Figure 1. Diagram of a possible pipeline created by ATOM.



Installation

Install ATOM's newest release easily via pip:

$ pip install -U atom-ml

or via conda:

$ conda install -c conda-forge atom-ml



Usage

Call the ATOMClassifier or ATOMRegressor class and provide the data you want to use:

from sklearn.datasets import load_breast_cancer
from atom import ATOMClassifier

X, y = load_breast_cancer(return_X_y=True)
atom = ATOMClassifier(X, y, logger="auto", n_jobs=2, verbose=2)

ATOM has multiple data cleaning methods to help you prepare the data for modelling:

atom.impute(strat_num="knn", strat_cat="most_frequent", max_nan_rows=0.1)  
atom.encode(strategy="LeaveOneOut", max_onehot=8, frac_to_other=0.05)  
atom.feature_selection(strategy="PCA", n_features=12)

Run the pipeline with the models you want to compare:

atom.run(
    models=["LR", "LDA", "XGB", "lSVM"],
    metric="f1",
    n_calls=25,
    n_initial_points=10,
    n_bootstrap=4,
)

Make plots to analyze the results:

atom.plot_results(figsize=(9, 6), filename="bootstrap_results.png")  
atom.lda.plot_confusion_matrix(normalize=True, filename="cm.png")



Documentation

For further information, please see the project's documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

atom-ml-4.6.0.tar.gz (362.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page