Skip to main content

This package is designed for swift and automated machine learning practice, catering to both classification and regression tasks. It facilitates model training, grid search application, and the preservation of the best model. Furthermore, it stores and visualizes the best scores attained by other models using commonly employed evaluation metrics.

Project description

AutomatedMLPack

A Comprehensive Package for Automated Machine Learning

scikit-learn

Project Overview: This package is designed for swift and automated machine learning practice, catering to both classification and regression tasks. It facilitates model training, grid search application, and the preservation of the best model. Furthermore, it stores and visualizes the best scores attained by other models using commonly employed evaluation metrics.

What you will get:

  • Training regression and classification models
    • regression models: RandomForestRegressor, DecisionTreeRegressor, GradientBoostingRegressor, LinearRegression, XGBRegressor,CatBoostRegressor,AdaBoostRegressor
    • classification models: RandomForestClassifier, DecisionTreeClassifier, GradientBoostingClassifier, LogisticRegression, XGBClassifier, CatBoostClassifier, AdaBoostClassifier, MLPClassifier, SVC
  • Parameter Tunning Using GridsearchCV
  • Feature Engineering Using Feature-Engine Package
  • Feature Selection: Recursive Feature Elimination (classification), Recursive Feature Addition (classification) and SelectKBest (regression)
  • Visualization of Scores

Installation

AutomatedMLPack requires a Python>=3.11.

Create Environment

conda create -n envname python=3.11 -y
conda activate envname

Install AutomatedMLPack Package

pip install automated-ml-pack

Usage:

As a Library

from automated_ml_pack.modules.run_train_pipeline import run_train_pipeline

if __name__ == '__main__':
    data_path = "/data.csv"
    target_column_name = "asthma_type"
    # run the training pipeline
    run_train_pipeline(input_file = data_path,  
                       target_column = target_column_name,
                       input_type = "csv",
                       training_type = "clf",
                       engineer_new_features=False,
                       output_base="",
                       test_size=0.2, 
                       no_standard_scaling=False,
                       feature_selection=False, 
                       feature_selection_method="addition",
                       selectkbest_num_features=32, 
                       output_dir="outputs",
                       verbose = True,
                       no_param_finetune = False
                      )

Command Line Interface

USAGE:
run_train_pipeline -[INPUT_FILE] [options]

This tool facilitates the training of multiple machine learning models, optimizes the models, and saves the trained models. It also conducts model evaluation using diverse methods. Furthermore, the tool is capable of handling both regression and classification tasks. Additional options are described below.

options:
-h, --help show this help message and exit
--input_file INPUT_FILE Path to the input data in CSV/TSV format.
--input_type {csv,tsv} Type of input file format (csv or tsv)
--training_type {clf,reg} Type of training (e.g., "classification", "regression")
--target_column TARGET_COLUMN Name of the target column in the input dataframe
--engineer_new_features Flag to perform engineering of new features or not.
--output_base OUTPUT_BASE Base Name for most output files.
--test_size TEST_SIZE What fraction of the dataset should be used for testing. Normally, cross validation is performed on the other percentage of the data to access the model' generalization.
--standard_scaling Whether or not to apply scikit-learn standard scaler on the data.
--feature_selection Whether or not to perform feature selection on the dataset.
--feature_selection_method {addition,elimination}
Specify between recursive feature addition and recursive feature elimination algorithms for classification. By default, recursive feature addition is applied. For regression tasks, SelectKBest is used for feature selection.
--selectkbest_num_features SELECTKBEST_NUM_FEATURES Number of top features to select. For regression only.
--output_dir OUTPUT_DIR
Custom Name of Output Folder.
--return_data Select to include raw data, training data and test data in the output folders.
--no_param_finetune If true, hyperparameter search will not be performed for each model. Otherwise, hyperparameter tunning is performed.

Tutorials

The data must be in csv or tsv format and the user must provide the column name that contains the targets. The following is an example of how the tool can be used for classification tasks.

run_train_pipeline --input_file heart.csv --target_column HeartDisease --training_type clf --test_size 0.2 --feature_selection --feature_selection_method addition --output_dir heart_disease_classification

This script will take some time to run. The outputs will be stored in the provided output directory.

outputs cross-validation-score

License

MIT
Free Software, Hell Yeah!

Contributors


Cyrille M. NJUME

Want to contribute? Great!
The projects does not cover the following for now:

  • Multi-class Classification
  • Improved Analysis of Results
  • More Flexibility

References

[1] krishnaik06: https://github.com/krishnaik06/mlproject

Contact

For any feedback or queries, please reach out to cyrillemesue@gmail.com.

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

automated_ml_pack-1.0.6.tar.gz (18.4 kB view details)

Uploaded Source

File details

Details for the file automated_ml_pack-1.0.6.tar.gz.

File metadata

  • Download URL: automated_ml_pack-1.0.6.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for automated_ml_pack-1.0.6.tar.gz
Algorithm Hash digest
SHA256 6ba2655c3529a84e9798e2bf30e114bd3e4aa10444bb00df576539872e78016b
MD5 ef3a7dba5ca90677ca88f582d74cc2d1
BLAKE2b-256 03f05d051101ff99f3c31fad42adbb1f36d6c20e03f5e352d2d38890a95abc62

See more details on using hashes here.

Supported by

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