AutoML (Automated Machine Learning) streamlines machine learning workflows, making them more accessible and efficient
for users of all experience levels. This crate extends the smartcore
machine learning framework, providing utilities to
quickly train, compare, and deploy models.
Add AutoML to your Cargo.toml
to get started:
Stable Version
automl = "0.2.9"
Latest Development Version
automl = { git = "https://github.com/cmccomb/rust-automl" }
Hereβs a quick example to illustrate how AutoML can simplify model training and comparison:
let dataset = smartcore::dataset::breast_cancer::load_dataset();
let settings = automl::Settings::default_classification();
let mut classifier = automl::SupervisedModel::new(dataset, settings);
classifier.train();
will perform a comparison of classifier models using cross-validation. Printing the classifier object will yield:
ββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββ¬ββββββββββββββββββββ¬βββββββββββββββββββ
β Model β Time β Training Accuracy β Testing Accuracy β
ββββββββββββββββββββββββββββββββββͺββββββββββββββββββββββͺββββββββββββββββββββͺβββββββββββββββββββ‘
β Random Forest Classifier β 835ms 393us 583ns β 1.00 β 0.96 β
ββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββΌβββββββββββββββββββ€
β Logistic Regression Classifier β 620ms 714us 583ns β 0.97 β 0.95 β
ββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββΌβββββββββββββββββββ€
β Gaussian Naive Bayes β 6ms 529us β 0.94 β 0.93 β
ββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββΌβββββββββββββββββββ€
β Categorical Naive Bayes β 2ms 922us 250ns β 0.96 β 0.93 β
ββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββΌβββββββββββββββββββ€
β Decision Tree Classifier β 15ms 404us 750ns β 1.00 β 0.93 β
ββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββΌβββββββββββββββββββ€
β KNN Classifier β 28ms 874us 208ns β 0.96 β 0.92 β
ββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββΌββββββββββββββββββββΌβββββββββββββββββββ€
β Support Vector Classifier β 4s 187ms 61us 708ns β 0.57 β 0.57 β
ββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββ΄ββββββββββββββββββββ΄βββββββββββββββββββ
You can then perform inference using the best model with the predict
method.
This crate has several features that add some additional methods.
Feature | Description |
---|---|
nd |
Adds methods for predicting/reading data using ndarray . |
csv |
Adds methods for predicting/reading data from a .csv using polars . |
- Feature Engineering
- PCA
- SVD
- Interaction terms
- Polynomial terms
- Regression
- Decision Tree Regression
- KNN Regression
- Random Forest Regression
- Linear Regression
- Ridge Regression
- LASSO
- Elastic Net
- Support Vector Regression
- Classification
- Random Forest Classification
- Decision Tree Classification
- Support Vector Classification
- Logistic Regression
- KNN Classification
- Gaussian Naive Bayes
- Meta-learning
- Blending
- Save and load settings
- Save and load models