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
Project details
Release history Release notifications | RSS feed
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63ef0067d4f93b0f8e8e9d216af89f540da990fcc2e7a80d280fda6dc06a067d
|
|
| MD5 |
3814b34b39976bd0d6dc813d5a14c35f
|
|
| BLAKE2b-256 |
35444385cb7e72c1a3559b6f62a3114459340ddab4df110e5f98fa7e5ef7e989
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44f4f548b9b56e6320b11365fec6a2fa91be71ae4a8a208633f3fbefa88a3c98
|
|
| MD5 |
d5d29ff577dd1ce51e40ddaa04971aee
|
|
| BLAKE2b-256 |
7a448ab65ed149c8976c2e3cf6412dd07e6cce9787fd3a43ac0104753fc4a76f
|