Skip to main content

Lightweight ML utility for automated training, evaluation, and prediction with CLI and Python API support

Project description

mlforgex Logo

Automated Machine Learning utility for streamlined training, evaluation, and prediction.



PyPI version Python versions License Stars Documentation GitHub Repository PyPI Downloads Listed in Awesome Machine Learning



Effortlessly scale your ML workflows with built-in preprocessing, hyperparameter tuning, ensembling, and an interactive dashboard.


🚀 What is mlforgex?

mlforgex is a lightweight, high-performance automated machine learning (AutoML) utility designed to drastically reduce boilerplate code. Whether you're working on Regression, Classification, or Natural Language Processing (NLP) tasks, mlforgex handles everything from data cleaning and scaling to advanced hyperparameter tuning and model ensembling.

With just a few lines of code, you get a fully trained pipeline and a beautiful interactive HTML dashboard of your model's performance.

✨ Key Features

  • 🧠 End-to-End AutoML: Automatically detects the problem type (Regression or Classification) and trains the best-in-class algorithms (XGBoost, LightGBM, CatBoost, Random Forest, etc.).
  • 🧹 Intelligent Preprocessing: Built-in outlier removal, skewness handling, highly-correlated feature dropping, and one-hot/ordinal encoding.
  • ⚖️ Imbalance Handling: Automatically detects and handles mild to severe class imbalances using Random Under-sampling or SMOTETomek.
  • 📝 Native NLP Support: Processes text data natively—tokenization, stopword removal, lemmatization, and Word2Vec embeddings out-of-the-box.
  • 🚀 Advanced Ensembles: Automatically constructs Stacking and Voting ensembles from the top-performing tuned models to maximize accuracy and minimize overfitting.
  • 📊 Interactive Dashboards: Generates comprehensive Plotly-based HTML dashboards with feature importance, correlation heatmaps, and metric curves (ROC, Precision-Recall).

📦 Installation

mlforgex is available on PyPI. Install it using pip:

pip install mlforgex

(Requires Python 3.8 or higher)

⚡ Quick Start

mlforgex makes training highly optimized models incredibly simple. Just provide the path to your dataset and the name of the target column.

Training a Model

from mlforgex.train import train_model

# Train a model for Classification or Regression automatically
train_model(
    data_path="data/dataset.csv",
    dependent_feature="target_column",
    n_iter=100,               # Number of randomized search iterations
    fast=False,               # Set to True for a quick baseline
    artifacts_dir="output",   # Directory to save models and dashboard
    dashboard_title="My Project Dashboard"
)

Training an NLP Model

from mlforgex.train import train_model

# Enable NLP mode for text classification
train_model(
    data_path="data/reviews.csv",
    dependent_feature="sentiment",
    nlp=True,                 # Turn on NLP processing
    artifacts_dir="nlp_output"
)

Making Predictions

Once trained, mlforgex saves a model.pkl and preprocessor.pkl inside your artifacts directory.

import pandas as pd
from mlforgex.predict import predict_data

# Load new unseen data
new_data = pd.read_csv("data/new_data.csv")

# Generate predictions using the saved artifacts
predictions = predict_data(
    data=new_data,
    artifacts_path="output/artifacts"
)

print(predictions)

📈 Interactive Dashboard

After every training run, mlforgex automatically generates a Dashboard.html in your artifacts folder. Open it in any web browser to explore:

  • Data insights and distribution shapes.
  • Correlation heatmaps.
  • Feature importances.
  • Interactive evaluation metric curves (e.g., ROC-AUC, Learning Curves).

🛠 Command Line Interface (CLI)

You can also use mlforgex directly from the terminal!

# Train a model
mlforgex-train --data my_data.csv --target price --out_dir my_models

# Make predictions
mlforgex-predict --data unseen.csv --artifacts my_models/artifacts

📘 Documentation

For advanced usage, custom thresholds, and API references, check out the full documentation:

👉 mlforgex Official Documentation

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. If you find a bug or have a feature request, please open an issue.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

Distributed under the MIT License. See LICENSE for more information.


Made with ❤️ by Priyanshu Mathur

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

mlforgex-1.2.0.tar.gz (42.0 kB view details)

Uploaded Source

Built Distribution

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

mlforgex-1.2.0-py3-none-any.whl (41.1 kB view details)

Uploaded Python 3

File details

Details for the file mlforgex-1.2.0.tar.gz.

File metadata

  • Download URL: mlforgex-1.2.0.tar.gz
  • Upload date:
  • Size: 42.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mlforgex-1.2.0.tar.gz
Algorithm Hash digest
SHA256 d68bec65310be8879b3f24b7ab28bc05333e97ddaf0bdda5ff44e369eb4479f8
MD5 519b5170ddf3c78e5950e4d8f1a3355b
BLAKE2b-256 14616873d7b8689cab041bdffe7a85f614f479b4141cc1473758b33e41f17110

See more details on using hashes here.

Provenance

The following attestation bundles were made for mlforgex-1.2.0.tar.gz:

Publisher: publish.yml on dhgefergfefruiwefhjhcduc/ML_Forgex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mlforgex-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: mlforgex-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 41.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mlforgex-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 436a1f36f5204fd38947e25b7c840524e127351cc2a6c9e913f6f5d0f630b6bf
MD5 546af69bee950e18beb4fb758644199c
BLAKE2b-256 377e771fa2efc83e2353eae227fa5d618f3b1ae2e233328fb28b1da2f1d748b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for mlforgex-1.2.0-py3-none-any.whl:

Publisher: publish.yml on dhgefergfefruiwefhjhcduc/ML_Forgex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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