Skip to main content

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

ml_algo_automation-0.1.5.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ml_algo_automation-0.1.5-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file ml_algo_automation-0.1.5.tar.gz.

File metadata

  • Download URL: ml_algo_automation-0.1.5.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

Hashes for ml_algo_automation-0.1.5.tar.gz
Algorithm Hash digest
SHA256 53d7adea259fe3f8c5f26f1f796c4b4e66af2edd53100d853a45adf03c685f57
MD5 4a3f500af3a1c3f7687dbaf46b407482
BLAKE2b-256 788c3f4378bd3b8aeb835b64d622b1c705800b16f1038370016f905f3528eb85

See more details on using hashes here.

File details

Details for the file ml_algo_automation-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for ml_algo_automation-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3d7fbd3c79be690c8c8c2d65b78510b523341e37def576d723b7056507fb5214
MD5 f034654fb48a6f98911da2f27bcc7fbf
BLAKE2b-256 a12c0c4dac3dbe5ae0d37ece3f347b915161d4027fdcdfb4ead22c46df7513ec

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