Lightweight ML utility for automated training, evaluation, and prediction with CLI and Python API support
Project description
Automated Machine Learning utility for streamlined training, evaluation, and prediction.
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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📄 License
Distributed under the MIT License. See LICENSE for more information.
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d68bec65310be8879b3f24b7ab28bc05333e97ddaf0bdda5ff44e369eb4479f8
|
|
| MD5 |
519b5170ddf3c78e5950e4d8f1a3355b
|
|
| BLAKE2b-256 |
14616873d7b8689cab041bdffe7a85f614f479b4141cc1473758b33e41f17110
|
Provenance
The following attestation bundles were made for mlforgex-1.2.0.tar.gz:
Publisher:
publish.yml on dhgefergfefruiwefhjhcduc/ML_Forgex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mlforgex-1.2.0.tar.gz -
Subject digest:
d68bec65310be8879b3f24b7ab28bc05333e97ddaf0bdda5ff44e369eb4479f8 - Sigstore transparency entry: 2172816223
- Sigstore integration time:
-
Permalink:
dhgefergfefruiwefhjhcduc/ML_Forgex@850d91d76d324f23d5a5e3a4162c70ad9e1f75f9 -
Branch / Tag:
refs/tags/1.2.0 - Owner: https://github.com/dhgefergfefruiwefhjhcduc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@850d91d76d324f23d5a5e3a4162c70ad9e1f75f9 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
436a1f36f5204fd38947e25b7c840524e127351cc2a6c9e913f6f5d0f630b6bf
|
|
| MD5 |
546af69bee950e18beb4fb758644199c
|
|
| BLAKE2b-256 |
377e771fa2efc83e2353eae227fa5d618f3b1ae2e233328fb28b1da2f1d748b4
|
Provenance
The following attestation bundles were made for mlforgex-1.2.0-py3-none-any.whl:
Publisher:
publish.yml on dhgefergfefruiwefhjhcduc/ML_Forgex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mlforgex-1.2.0-py3-none-any.whl -
Subject digest:
436a1f36f5204fd38947e25b7c840524e127351cc2a6c9e913f6f5d0f630b6bf - Sigstore transparency entry: 2172816245
- Sigstore integration time:
-
Permalink:
dhgefergfefruiwefhjhcduc/ML_Forgex@850d91d76d324f23d5a5e3a4162c70ad9e1f75f9 -
Branch / Tag:
refs/tags/1.2.0 - Owner: https://github.com/dhgefergfefruiwefhjhcduc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@850d91d76d324f23d5a5e3a4162c70ad9e1f75f9 -
Trigger Event:
release
-
Statement type: