Skip to main content

🚀 MLCompare

Compare Machine Learning Models in Just a Few Lines of Code

A lightweight, beginner-friendly Python package for Classification and Regression that helps you train, evaluate, compare, and save Machine Learning models with a simple API.

PyPI version Python Version PyPI Downloads License GitHub Stars

📦 View on PyPI   •   💻 View on GitHub


🧠 What is MLCompare?

Machine Learning experimentation often involves repeating the same workflow for multiple algorithms:

Prepare Data → Select Model → Train → Evaluate → Compare

Doing this manually for every model can lead to repetitive code and slower experimentation.

MLCompare is designed to simplify this process by providing a reusable interface for comparing multiple Machine Learning models for Classification and Regression tasks.

Goal: Reduce repetitive ML boilerplate and make model comparison simple, fast, and beginner-friendly.


✨ Features

  • 🎯 Classification & Regression support
  • 🤖 Multiple model comparison in a single workflow
  • 📊 Performance evaluation and result comparison
  • 🏆 Best model selection
  • 💾 Save trained models
  • 📂 Load saved models
  • 🔮 Prediction support
  • 🧩 Simple and beginner-friendly API
  • 🐍 Built with the Scikit-Learn ecosystem

📦 Installation

Install from PyPI

pip install mlcompare-dev

Install locally for development

git clone https://github.com/Developer-Manish007/mlcompare.git
cd mlcompare
pip install -e .
Resource Link
📦 PyPI Package https://pypi.org/project/mlcompare-dev/
💻 GitHub Repository https://github.com/Developer-Manish007/mlcompare

🚀 Quick Start

from mlcompare import MLCompare
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split

# Load dataset
X, y = load_iris(return_X_y=True)

# Split dataset
X_train, X_test, y_train, y_test = train_test_split(
    X,
    y,
    test_size=0.2,
    random_state=42
)

# Create MLCompare object
mc = MLCompare()

# Train models
mc.fit(X_train, y_train)

# Compare models
results = mc.compare()

print(results)

💾 Save a Model

Save a trained model for later use:

mc.save("best_model.pkl")

📂 Load a Model

from mlcompare import load_model

model = load_model("best_model.pkl")

📊 Supported Models

🔵 Classification

  • Logistic Regression
  • K-Nearest Neighbors (KNN)
  • Decision Tree
  • Random Forest
  • Support Vector Machine (SVM)
  • Gaussian Naive Bayes

🟢 Regression

  • Linear Regression
  • Decision Tree Regressor
  • Random Forest Regressor
  • K-Neighbors Regressor
  • Support Vector Regressor

🔄 MLCompare Workflow

              ┌─────────────────┐
              │     Dataset     │
              └────────┬────────┘
                       ↓
              ┌─────────────────┐
              │   Data Setup    │
              └────────┬────────┘
                       ↓
              ┌─────────────────┐
              │  Model Training │
              └────────┬────────┘
                       ↓
              ┌─────────────────┐
              │    Evaluation   │
              └────────┬────────┘
                       ↓
              ┌─────────────────┐
              │ Model Comparison│
              └────────┬────────┘
                       ↓
              ┌─────────────────┐
              │   Best Model    │
              └─────────────────┘

The workflow is designed to make it easier to experiment with multiple models without rewriting the same comparison logic repeatedly.


🧪 Example Use Case

Suppose you have a classification dataset and want to test several algorithms.

Instead of creating separate training and evaluation code for every model, MLCompare provides a common workflow where the models can be trained and compared together.

This is especially useful for:

  • 📚 Learning Machine Learning
  • 🔬 Model experimentation
  • 📊 Exploratory model comparison
  • 🧑‍💻 Data Science projects
  • ⚡ Rapid prototyping

📁 Project Structure

mlcompare/
│
├── mlcompare/
│   ├── core.py
│   ├── models.py
│   ├── metrics.py
│   ├── save.py
│   ├── utils.py
│   ├── version.py
│   └── __init__.py
│
├── examples/
├── README.md
├── setup.py
├── requirements.txt
├── LICENSE
└── .gitignore

🛣️ Roadmap

v0.2.0

  • StandardScaler
  • MinMaxScaler
  • RobustScaler
  • Cross Validation
  • More Evaluation Metrics

v0.3.0

  • Hyperparameter Tuning
  • Feature Importance
  • Model Explainability

v1.0.0

  • AutoML Workflow
  • Pipeline Support
  • SHAP Integration
  • XGBoost
  • LightGBM
  • CatBoost

🤝 Contributing

Contributions, feature requests, improvements, and bug reports are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test your changes
  5. Open a Pull Request

📄 License

MLCompare is released under the MIT License.


👨‍💻 Author

Manish Kumar

Aspiring Data Scientist & Machine Learning Engineer


⭐ Support MLCompare

If you find MLCompare useful, consider giving the repository a ⭐ on GitHub.

📦 Install from PyPI   •   ⭐ Star on GitHub

Built with 🐍 Python & ❤️ for the Machine Learning community

Metadata

Release files for mlcompare-dev 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mlcompare-dev 0.1.2
File Size Uploaded Provenance
mlcompare_dev-0.1.2.tar.gz 10.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mlcompare-dev 0.1.2
File Interpreter ABI Platform
mlcompare_dev-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 19.2 kB

Release files / mlcompare_dev-0.1.2.tar.gz

Download URL mlcompare_dev-0.1.2.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c1471eb0fdc94e38412dc465fd54f3d7be4be6b79d45cd11d8d231275c08c5ea
BLAKE2b-256 checksum
How to use checksums
44c616e338a1413ea08ee1a3c3736a425b384634aa2966937df34f12ecc82630
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release files / mlcompare_dev-0.1.2-py3-none-any.whl

Download URL mlcompare_dev-0.1.2-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38ed5e930e0ff762df5940efcdb61cec4871adef03531f59f001d5e4b33d961b
BLAKE2b-256 checksum
How to use checksums
2ebff07e75a931d72c80dce59b6b013859e08ff99c13264d212bbd1cc0d5b917
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Security for mlcompare-dev 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page