A previous release had provenance metadata, but this release does not. View details.
🔨 ModelForge
A transparent, local-first AutoML framework for Python
Give it a dataset and a target column. It handles the rest — transparently.
Installation • Quick Start • Configuration • Architecture • Stress Test Results • Roadmap
What is ModelForge?
ModelForge is a local-first AutoML framework that automates the repetitive parts of a machine learning workflow — data profiling, quality auditing, preprocessing, pipeline construction, model evaluation, cross-validation, ranking, and reporting — while staying inspectable at every step.
Unlike black-box AutoML tools, ModelForge is built around one core principle:
You should always be able to see what it did and why.
Give it a dataset and a target column:
import pandas as pd
from modelforge.automl import AutoML
df = pd.read_csv("dataset.csv")
automl = AutoML()
automl.fit(df, target="target_column")
And it walks through the full pipeline automatically:
Dataset → Loading → Profiling → Data Quality Audit → Target/Task Detection
→ Column Intelligence → Feature Selection/Engineering → Preprocessing
→ Pipeline Generation → Multi-Model Evaluation → Cross-Validation
→ Metric Calculation → Model Ranking → Best Model Selection
→ (Optional) Hyperparameter Optimization → Explainability
→ Persistence/Artifacts → Experiment Tracking → Human-Readable Report
Installation
pip install autoforge-engine
Install a specific version:
pip install autoforge-engine==1.0.1
Verify the install:
pip show autoforge-engine
python -c "import modelforge; print(modelforge.__file__)"
Note: the PyPI distribution name is
autoforge-engine, but the importable package ismodelforge.
Quick Start
Using the AutoML class
import pandas as pd
from modelforge.automl import AutoML
df = pd.read_csv("autoforge_10000_test_dataset.csv")
automl = AutoML()
automl.fit(df, target="loan_default")
Using the convenience function
from modelforge.automl import automl
result = automl(
data=df,
target="loan_default"
)
Command line
modelforge --help
Selecting and Exporting a Model
ModelForge evaluates and ranks candidate models automatically. By default,
best_model / best_pipeline hold the top-ranked result, and save() persists
that automatically recommended pipeline.
You can override the recommendation after fit() without re-running AutoML.
The selected candidate is refitted on the full training dataset before it is
used for prediction or export. The exported artifact is the complete
scikit-learn pipeline (preprocessing + estimator). Metadata records how the
model was selected.
Automatic behavior
automl.fit(df, target="target")
automl.save("best_model.joblib")
Select by rank
automl.fit(df, target="target")
automl.select_model(rank=2)
automl.export_model(
"selected_model.joblib"
)
Select by model name
automl.select_model(
model="random_forest_classifier"
)
automl.export_model(
"random_forest_model.joblib"
)
Notes:
best_modelremains the automatically ranked best model.selected_model/selected_pipelinehold the user override.- After
select_model(),predict()andpredict_proba()use the selected pipeline. Before selection they continue to use the best pipeline. save()always saves the automatically ranked best model.export_model()saves the selected model when one was chosen; otherwise it saves the best model.
CLI selection
Export a ranked model without changing the default train workflow:
modelforge train \
--data data.csv \
--target target \
--model-rank 2 \
--output random_forest_model.joblib
Or select by registry model name:
modelforge train \
--data data.csv \
--target target \
--model random_forest_classifier \
--output random_forest_model.joblib
Existing modelforge train commands without --model / --model-rank
continue to save the automatically recommended best model.
Configuration
The AutoML constructor supports the following parameters:
AutoML(
test_size=0.2,
cv=5,
random_state=42,
objective="balanced",
variance_threshold=None,
correlation_threshold=None,
enable_optimization=False,
optimization_models=3,
optimization_max_trials=10,
experiment_directory=".modelforge/experiments",
config=None
)
| Parameter | Description |
|---|---|
test_size |
Holdout test fraction |
cv |
Number of cross-validation folds |
random_state |
Reproducibility seed |
objective |
Model ranking objective (default: "balanced") |
variance_threshold |
Optional low-variance feature filtering |
correlation_threshold |
Optional high-correlation feature filtering |
enable_optimization |
Enables/disables hyperparameter optimization |
optimization_models |
Number of models considered for optimization |
optimization_max_trials |
Maximum optimization trials |
experiment_directory |
Where experiment metadata/artifacts are stored |
The automatic post-fit report can be suppressed with print_report=False (if supported by the installed fit() signature).
What ModelForge Does
🧹 Data Quality Auditing
Automatically flags:
- Missing values
- Duplicate rows
- Constant columns
- Possible identifier columns
- Other dataset-quality findings
🎯 Target & Task Detection
Given a target column, ModelForge determines whether the problem is classification or regression.
⚙️ Preprocessing
Builds a leakage-safe scikit-learn Pipeline / ColumnTransformer:
| Data type | Steps |
|---|---|
| Numerical | SimpleImputer → StandardScaler |
| Categorical | SimpleImputer → OneHotEncoder |
Preprocessing is fit independently inside each cross-validation fold to prevent data leakage.
🤖 Model Evaluation
Evaluates multiple candidate models (verified against source for the current release), including — for classification tasks — Logistic Regression, Random Forest, Extra Trees, Gradient Boosting, K-Nearest Neighbors, Support Vector Classifier, and Decision Tree.
🔁 Cross-Validation
Uses StratifiedKFold (n_splits=5, shuffle=True, random_state=42) for classification tasks where class counts permit. Each fold clones the pipeline fresh, fits on the training split, and evaluates on the validation split.
📊 Metrics
Classification: Accuracy, Precision, Recall, F1 (average="weighted", zero_division=0), ROC-AUC (via predict_proba or decision_function), Log Loss.
Regression: R², Adjusted R², MAE, MSE, RMSE, MAPE.
🏆 Model Ranking
Candidate models are ranked according to the configured objective (default: "balanced") rather than by a single metric alone.
📄 Automatic Reporting
After fit(), ModelForge generates a human-readable report covering dataset shape, target/task, data-quality findings, evaluated models and metrics, the selected model, pipeline steps, run/experiment IDs, and run duration.
Architecture
ModelForge is organized into focused modules, each with a single responsibility:
| Module | Responsibility |
|---|---|
data_loader.py |
Dataset loading |
profiler.py |
Dataset profiling |
data_audit.py |
Data quality / auditing |
target_selector.py |
Target and task detection |
column_intelligence.py |
Column-level analysis |
feature_engineering.py |
Feature engineering |
feature_selection.py |
Feature selection |
preprocessing.py |
Imputation, scaling, encoding |
pipeline_generator.py |
sklearn pipeline construction |
model_registry.py |
Candidate model catalog |
model_screening.py |
Fast holdout evaluation |
cross_validation.py |
K-fold cross-validation |
evaluation.py |
Metric computation |
ranking.py |
Model ranking logic |
hyperparameter_optimization.py |
Optional HPO |
explainability.py |
Model explainability |
persistence.py |
Model save/load |
artifact_manager.py |
Artifact management |
experiment_tracker.py |
Experiment tracking |
reproducibility.py / reproducibility_integration.py |
Reproducibility guarantees |
prediction_validator.py |
Prediction-time validation |
run_manager.py |
Run metadata |
cli.py |
Typer-based CLI |
automl.py |
Orchestration layer |
config.py |
Configuration handling |
Note on Model Screening vs. Cross-Validation: these are distinct evaluation paths.
ModelScreeningEngineperforms a fasttrain_test_split(80/20, stratified where applicable) holdout evaluation, whileCrossValidationEngineperforms full K-fold evaluation. Holdout screening metrics and CV metrics should not be conflated.
Stress Test Results
ModelForge 0.1.4 was validated against a synthetic 10,020-row, 18-column dataset (target: loan_default) intentionally containing missing values, duplicates, a constant feature, and an identifier-like column.
Data quality detected: 1,000 missing cells · 20 duplicate rows · 3 quality findings (all correctly identified)
Cross-validation accuracy:
| Model | CV Accuracy |
|---|---|
| Logistic Regression | 69.51% |
| Gradient Boosting | 69.51% |
| SVC | 69.12% |
| Random Forest | 69.02% |
| Extra Trees | 68.26% |
| KNN | 64.52% |
| Decision Tree | 58.59% |
Selected model: Logistic Regression · Run time: ~33.25 seconds
These figures are a functional stress-test snapshot, not a claim that any single algorithm is universally best.
Independent Validation
Results were cross-checked against raw scikit-learn implementations. Six of seven models matched almost exactly; Decision Tree showed a ~0.13 percentage-point difference (58.59% vs. 58.72%), currently logged as an open, low-priority investigation rather than a confirmed defect.
Testing & Validation
- ✅ 491 tests passing locally
- ✅ GitHub Actions CI passing
- ✅ Package built (
.tar.gz+.whl) and validated withtwine check - ✅ Published to PyPI:
autoforge-engine
Test coverage includes unit, integration, CLI, preprocessing, model evaluation, cross-validation, ranking, persistence, experiment tracking, edge cases, and large mixed-type stress tests.
Development Workflow
# Run tests
pytest
# Build the package
python -m build
# Validate the build
python -m twine check dist/*
# Upload to PyPI
python -m twine upload dist/*
Roadmap
- Investigate the minor Decision Tree CV discrepancy (
model_registry/pipeline_generator/preprocessing) - Expand hyperparameter optimization coverage
- Broaden regression model support
- Deepen explainability outputs
- Continued CLI and documentation improvements
Philosophy
ModelForge is built to demonstrate serious ML engineering practice — not to replace a data scientist's judgment. It automates repeatable, mechanical steps of an ML workflow (preprocessing, evaluation, cross-validation, ranking, reporting) while keeping every step reproducible and inspectable, so the framework never becomes a black box.
Author
Aditya Kumar Singh
License
Links
- 📦 PyPI: autoforge-engine
- 💻 GitHub: ModelForge
Metadata
Release files for autoforge-engine 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Loss of provenance
These files do not have provenance metadata, despite files in a prior release including this data.
We recommend further investigation before installing these files. View details.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| autoforge_engine-1.0.1.tar.gz | 102.3 kB | Without provenance | Details for autoforge_engine-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| autoforge_engine-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for autoforge_engine-1.0.1-py3-none-any.whl |
Total release size: 178.6 kB
Release files / autoforge_engine-1.0.1.tar.gz
Loss of provenance
This file belongs to a release without provenance metadata, despite a prior release including this data.
We recommend further investigation before installing this file. View details.
| Download URL | autoforge_engine-1.0.1.tar.gz |
|---|---|
| Size | 102.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a68fa199a47007ded892293d5b601b4d631a9482b32aad116afd1ad5a571f7ea
|
|
BLAKE2b-256 checksum How to use checksums |
28a2e96b2cc46a2feb8f22c2cdd41f4da50576b84c927b2dd95a96b061d010be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / autoforge_engine-1.0.1-py3-none-any.whl
Loss of provenance
This file belongs to a release without provenance metadata, despite a prior release including this data.
We recommend further investigation before installing this file. View details.
| Download URL | autoforge_engine-1.0.1-py3-none-any.whl |
|---|---|
| Size | 76.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
786ab40fc58f623c1f69748699fbcb3c5fd0871d4a26f6ed2596bd9c22fdd2c2
|
|
BLAKE2b-256 checksum How to use checksums |
5971b8e466d5fb1d9a8e40a95f8d30edb81a661cf24fd79e46ff8ee5eaa8d34a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Security for autoforge-engine 1.0.1
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.
Loss of provenance
A previous release of these files had provenance metadata, but this release does not.
While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.
Release comparison
- Removed 1.0.0 2 files With provenance
- Added 1.0.1 2 files Without provenance
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.