A library for comparing regression and classification models using scikit-learn.
Project description
ML Automation
ml_algo_automation is a Python library that allows you to compare multiple machine learning models for both regression and classification tasks, using scikit-learn. It evaluates models based on various metrics and selects the best one according to the specified criterion.
Features
- Compare multiple regression models (Linear Regression, Decision Tree, Random Forest, etc.)
- Compare multiple classification models (Logistic Regression, SVM, Random Forest, etc.)
- Select the best model based on metrics like R² Score, Accuracy, Precision, Recall, etc.
Installation
You can install the package via pip:
pip install ml-algo-automation
Usage
###Regression Example
from ml_algo_automation.ml_model_comparator import a_b_testing_regression, get_best_model, get_model_results
from sklearn.datasets import load_diabetes
# Load the diabetes dataset
data = load_diabetes()
X, y = data.data, data.target
# Run the regression testing function
models, results = a_b_testing_regression(X, y)
# Find the best model based on R² Score
best_model_name = get_best_model(results, metric="R² Score")
print(f"\nThe best model based on R² Score is: {best_model_name} with an R² Score of {results[best_model_name]['R² Score']:.4f}\n")
# Print all model results
get_model_results(results)
###Classification Example
from ml_algo_automation.ml_model_comparator import a_b_testing_classification, get_best_model, get_model_results
from sklearn.datasets import load_wine
# Load a sample dataset
data = load_wine()
X, y = data.data, data.target
# Run the classification testing function
models, results = a_b_testing_classification(X, y)
# Find the best model based on Precision
best_model_name = get_best_model(results, metric="Precision")
print(f"\nThe best model based on Precision is: {best_model_name} with a Precision of {results[best_model_name]['Precision']:.4f}\n")
# Print all model results
get_model_results(results)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ml_algo_automation-0.1.4.tar.gz.
File metadata
- Download URL: ml_algo_automation-0.1.4.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe324eab7a262c6302f3c20926afccb1f14f7c139433aba6d44400684972ce93
|
|
| MD5 |
37dac1f67f89f20dd7cc800479a5de0f
|
|
| BLAKE2b-256 |
4f72fc87180c21a1bd0d2dd4231921f6c8841cf63e4796d484bc6f1da65d3bad
|
File details
Details for the file ml_algo_automation-0.1.4-py3-none-any.whl.
File metadata
- Download URL: ml_algo_automation-0.1.4-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
204801de2a0d7f8798aeaee9871ab7b1a3acee3caded4cc421b94205ba1ea6f3
|
|
| MD5 |
0b88b576ddf5d7b797db62a5bffddbfc
|
|
| BLAKE2b-256 |
694dbf8f45d069f32aad47acea863191e45aefe48074869bd0a1aeeca84d4be9
|