AutoML is Automated Machine Learning, referring to processes and methods to make machine learning more accessible for a general audience. This crate builds on top of the smartcore machine learning framework, and provides some utilities to quickly train and compare models.
To use the latest released version of AutoML
, add this to your Cargo.toml
:
automl = "0.3.0"
To use the bleeding edge instead, add this:
automl = { git = "https://github.com/cmccomb/rust-automl" }
Running the following:
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