<jupyter_start><jupyter_text>TinyAutoML is a Machine Learning Python3.9 library thought as an extension of Scikit-Learn. It builds an adaptable and auto-tuned pipeline to handle binary classification tasks. <a href="https://github.com/g0bel1n/TinyAutoML/actions/workflows/python-app.yml" target="_blank"><a href="https://www.python.org/downloads/release/python-390/" target="_blank">---In a few words, your data goes through 2 main preprocessing steps. The first one is scaling and NonStationnarity correction, which is followed by Lasso Feature selection.Finally, one of the three MetaModels is fitted on the transformed data.---  Latest News ! :* Logging format changed from default to [TinyAutoML]* Added Github Actions Workflow for CI, for updating the README.md !* Added parallel computation of `LassoFeatureSelector` -> [LassoFeatureSelectionParallel](https://github.com/g0bel1n/TinyAutoML/blob/master/TinyAutoML/Preprocessing/LassoFeatureSelectionParallel.py)* New [example notebook](https://github.com/g0bel1n/TinyAutoML/blob/master/notebooks/vix_example.ipynb) based on VIX index directionnal forecasting  ⚡️ Quick start First, let's install and import the library ! - Install the last release using pip```python%pip install TinyAutoML````<jupyter_code>import os
os.chdir('..') #For Github CI, you don't have to run that
from TinyAutoML.Models import *
from TinyAutoML import MetaPipeline<jupyter_output><empty_output><jupyter_text>`MetaModels``MetaModels` inherit from the `MetaModel` Abstract Class. They all implement ensemble methods and therefore are based on `EstimatorPools`.When training `EstimatorPools`, you are faced with a choice :  doing `parameterTuning` on entire pipelines with the estimators on the top or training the estimators using the same pipeline and only training the top. The first case refers to what we will be calling `comprehensiveSearch`.Moreover, as we will see in details later, those `EstimatorPools` can be shared across `MetaModels`.They are all initialised with those minimum arguments :```pythonMetaModel(comprehensiveSearch: bool = True, parameterTuning: bool = True, metrics: str = 'accuracy', nSplits: int=10)```- `nSplits` corresponds to the number of split of the cross validation- The other parameters are equivoque**They need to be put in the `MetaPipeline` wrapper to work** **There are 3 `MetaModels`**1- `BestModel` : selects the best performing model of the pool<jupyter_code>best_model = MetaPipeline(BestModel(comprehensiveSearch = False, parameterTuning = False))<jupyter_output><empty_output><jupyter_text>2- `OneRulerForAll` : implements Stacking using a `RandomForestClassifier` by default. The user is free to use another classifier using the ruler arguments<jupyter_code>orfa_model = MetaPipeline(OneRulerForAll(comprehensiveSearch=False, parameterTuning=False))<jupyter_output><empty_output><jupyter_text>3- `DemocraticModel` : implements Soft and Hard voting models through the voting argument<jupyter_code>democratic_model = MetaPipeline(DemocraticModel(comprehensiveSearch=False, parameterTuning=False, voting='soft'))<jupyter_output><empty_output><jupyter_text>As of release v0.2.3.2 (13/04/2022) there are 5 models on which these `MetaModels` rely in the `EstimatorPool`:- Random Forest Classifier- Logistic Regression- Gaussian Naive Bayes- Linear Discriminant Analysis- XGBoost***We'll use the breast_cancer dataset from `sklearn` as an example:<jupyter_code>import pandas as pd
from sklearn.datasets import load_breast_cancer

cancer = load_breast_cancer()
 
X = pd.DataFrame(data=cancer.data, columns=cancer.feature_names)
y = cancer.target

cut = int(len(y) * 0.8)

X_train, X_test = X[:cut], X[cut:]
y_train, y_test = y[:cut], y[cut:]<jupyter_output><empty_output><jupyter_text>Let's train a `BestModel` first and reuse its Pool for the other `MetaModels`<jupyter_code>best_model.fit(X_train,y_train)<jupyter_output>[TinyAutoML] Training models...
[TinyAutoML] The best estimator is random forest classifier with a cross-validation accuracy (in Sample) of 1.0<jupyter_text>We can now extract the pool<jupyter_code>pool = best_model.get_pool()<jupyter_output><empty_output><jupyter_text>And use it when fitting the other `MetaModels` to skip the fitting of the underlying models:<jupyter_code>orfa_model.fit(X_train,y_train,pool=pool)
democratic_model.fit(X_train,y_train,pool=pool)<jupyter_output>[TinyAutoML] Training models...
[TinyAutoML] Training models...<jupyter_text>Great ! Let's look at the results with the sk_learn `classification_report` :<jupyter_code>orfa_model.classification_report(X_test,y_test)<jupyter_output>precision    recall  f1-score   support

           0       0.92      0.92      0.92        26
           1       0.98      0.98      0.98        88

    accuracy                           0.96       114
   macro avg       0.95      0.95      0.95       114
weighted avg       0.96      0.96      0.96       114<jupyter_text>Looking good! What about the `roc_curve` ?<jupyter_code>democratic_model.roc_curve(X_test,y_test)<jupyter_output><empty_output><jupyter_text>Let's see how the estimators of the pool are doing individually:<jupyter_code>best_model.get_scores(X_test,y_test)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0897239263803681, 'fraction_numerical': 0.017254601226993866, 'mean_word_length': 5.5540201005025125, 'pattern_counts': {'":': 0, '<': 44, '<?xml version=': 0, '>': 45, 'https://': 4, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '544641', 'license': 'MIT', 'n_tokens_mistral': 1671, 'n_tokens_neox': 1570, 'n_words': 481, 'path': 'notebooks/introduction-to-Tiny-AutoML.ipynb', 'repo_name': 'g0bel1n/TinyAutoML', 'size': '5216'}