Skip to main content

Compare classification and regression ML models

Project description

๐Ÿš€ MLCompare

MLCompare is a beginner-friendly Python library to compare multiple Machine Learning models with just a few lines of code.

Instead of writing repetitive code for training and evaluating models, MLCompare automatically trains multiple algorithms, compares their performance, selects the best model, and allows prediction and model saving.


โœจ Features

  • โœ… Automatic Classification & Regression Detection
  • โœ… Train Multiple ML Models
  • โœ… Compare Model Performance
  • โœ… Automatically Select Best Model
  • โœ… Predict Using Best Model
  • โœ… Save & Load Trained Model
  • โœ… Simple Beginner-Friendly API

๐Ÿ“ฆ Installation

pip install mlcompare

Or install locally

pip install -e .

๐Ÿ“š Supported Models

Classification

  • Logistic Regression
  • K-Nearest Neighbors (KNN)
  • Support Vector Machine (SVM)
  • Decision Tree
  • Random Forest
  • AdaBoost
  • Gradient Boosting
  • Extra Trees

Regression

  • Linear Regression
  • Ridge Regression
  • Lasso Regression
  • ElasticNet
  • Decision Tree Regressor
  • Random Forest Regressor
  • Gradient Boosting Regressor
  • Extra Trees Regressor

๐Ÿš€ Quick Start

from mlcompare import MLCompare
import pandas as pd

df = pd.read_csv("data.csv")

ml = MLCompare(
    data=df,
    target="target"
)

results = ml.compare()

print(results)

๐Ÿ† Best Model

print(ml.best_model_name)

๐Ÿ”ฎ Prediction

new_data = df.drop(columns=["target"]).head()

predictions = ml.predict(new_data)

print(predictions)

๐Ÿ’พ Save Model

ml.save("best_model.pkl")

๐Ÿ“‚ Load Model

ml.load("best_model.pkl")

๐Ÿ“Š Example Output

Model Accuracy
SVM 0.95
Random Forest 0.94
Extra Trees 0.93
Logistic Regression 0.91

๐Ÿ“ Project Structure

mlcompare/
โ”‚
โ”œโ”€โ”€ core.py
โ”œโ”€โ”€ models.py
โ”œโ”€โ”€ metrics.py
โ”œโ”€โ”€ utils.py
โ”œโ”€โ”€ save.py
โ”œโ”€โ”€ version.py
โ””โ”€โ”€ __init__.py

๐Ÿ›  Requirements

  • Python 3.10+
  • pandas
  • numpy
  • scikit-learn
  • joblib

๐Ÿ“Œ Roadmap

Upcoming Features

  • Hyperparameter Tuning
  • Cross Validation
  • Feature Importance
  • Confusion Matrix
  • ROC-AUC Score
  • StandardScaler Support
  • Missing Value Handling
  • Categorical Encoding
  • XGBoost
  • LightGBM
  • CatBoost

๐Ÿค Contributing

Contributions are welcome!

Feel free to open an Issue or submit a Pull Request.


๐Ÿ“„ License

MIT License


๐Ÿ‘จโ€๐Ÿ’ป Author

Manish Kumar

GitHub: https://github.com/Developer-Manish007

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

mlcompare_dev-0.1.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

mlcompare_dev-0.1.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file mlcompare_dev-0.1.1.tar.gz.

File metadata

  • Download URL: mlcompare_dev-0.1.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for mlcompare_dev-0.1.1.tar.gz
Algorithm Hash digest
SHA256 63ef0067d4f93b0f8e8e9d216af89f540da990fcc2e7a80d280fda6dc06a067d
MD5 3814b34b39976bd0d6dc813d5a14c35f
BLAKE2b-256 35444385cb7e72c1a3559b6f62a3114459340ddab4df110e5f98fa7e5ef7e989

See more details on using hashes here.

File details

Details for the file mlcompare_dev-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mlcompare_dev-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for mlcompare_dev-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 44f4f548b9b56e6320b11365fec6a2fa91be71ae4a8a208633f3fbefa88a3c98
MD5 d5d29ff577dd1ce51e40ddaa04971aee
BLAKE2b-256 7a448ab65ed149c8976c2e3cf6412dd07e6cce9787fd3a43ac0104753fc4a76f

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