MLFCrafter
๐ ML Pipeline Automation Tool
Build, train, and deploy machine learning models with minimal code through chainable "crafter" components.
What is MLFCrafter?¶
MLFCrafter is a powerful Python Tool that simplifies machine learning pipeline creation through a modular, chainable architecture. Instead of writing repetitive boilerplate code, you can compose sophisticated ML workflows by connecting specialized "crafters" together.
from mlfcrafter import MLFChain, DataIngestCrafter, CleanerCrafter, ModelCrafter
# Create a complete ML pipeline in 4 lines
chain = MLFChain(
DataIngestCrafter(data_path="data.csv"),
CleanerCrafter(strategy="auto"),
ModelCrafter(model_name="random_forest")
)
results = chain.run(target_column="target")
print(f"Model accuracy: {results['test_score']:.4f}")
โจ Key Features¶
๐ Chainable Architecture¶
Connect multiple processing steps seamlessly with intelligent data flow between components.
๐ง Smart Data Handling¶
- Auto-detection: CSV, Excel, JSON formats automatically detected
- Intelligent cleaning: Multiple strategies for missing values
- Flexible scaling: MinMax, Standard, Robust scaling options
๐ค Multiple ML Models¶
- Random Forest: Ensemble method for robust predictions
- XGBoost: Gradient boosting for high performance
- Logistic Regression: Linear models for interpretability
๐ Comprehensive Metrics¶
Track model performance with accuracy, precision, recall, and F1-score automatically.
๐ Easy Deployment¶
One-click model saving with metadata, scalers, and complete reproducibility.
๐ Professional Logging¶
Detailed pipeline tracking with configurable log levels for debugging and monitoring.
๐๏ธ Architecture Overview¶
MLFCrafter uses a context-based pipeline architecture where each crafter:
- Receives a context dictionary with data and metadata
- Processes the data according to its specialization
- Returns an updated context for the next crafter
๐ DataIngestCrafter โ ๐งน CleanerCrafter โ CategoricalCrafter โ โ๏ธ ScalerCrafter โ ๐ค ModelCrafter โ ๐ ScorerCrafter โ ๐ DeployCrafter
Pipeline Flow:
1. DataIngestCrafter: Load data from CSV/Excel/JSON files
2. CleanerCrafter: Handle missing values with various strategies
3. CategoricalCrafter: Converts categorical variables into numerical data.
4. ScalerCrafter: Normalize numerical features (MinMax/Standard/Robust)
5. ModelCrafter: Train ML models (Random Forest, XGBoost, Logistic Regression)
6. ScorerCrafter: Calculate performance metrics (Accuracy, Precision, Recall, F1)
7. DeployCrafter: Save trained models with metadata for deployment
๐ ๏ธ Available Crafters¶
Crafter | Purpose | Key Features |
---|---|---|
DataIngestCrafter | Data loading | CSV, Excel, JSON with auto-detection |
CleanerCrafter | Data cleaning | Multiple missing value strategies |
CategoricalCrafter | Feature encoding | One-Hot Encoding, Label Encoding |
ScalerCrafter | Feature scaling | MinMax, Standard, Robust scalers |
ModelCrafter | Model training | RF, XGBoost, LogReg with hyperparameters |
ScorerCrafter | Performance metrics | Accuracy, Precision, Recall, F1 |
DeployCrafter | Model deployment | Joblib/Pickle with metadata |
๐ Quick Start¶
Installation¶
Your First Pipeline¶
from mlfcrafter import *
import pandas as pd
# Load your data
chain = MLFChain(
DataIngestCrafter(data_path="your_data.csv"),
CleanerCrafter(strategy="mean"), # Handle missing values
CategoricalCrafter(encoder_type="onehot"), # Convert categorical values to numerical
ScalerCrafter(scaler_type="standard"), # Normalize features
ModelCrafter(model_name="random_forest"), # Train model
ScorerCrafter(), # Calculate metrics
DeployCrafter(model_path="my_model.joblib") # Save model
)
# Run the entire pipeline
results = chain.run(target_column="your_target_column")
# Check results
print(f"๐ฏ Test Accuracy: {results['test_score']:.4f}")
print(f"๐ All Metrics: {results['scores']}")
print(f"๐พ Model Saved: {results['deployment_successful']}")
๐ Learn More¶
-
๐ Getting Started
New to MLFCrafter? Start here with installation and your first pipeline.
-
๐ User Guide
Learn pipeline basics, data processing, and advanced features.
-
๐ง API Reference
Complete documentation of all crafters, parameters, and methods.
-
๐ก Examples
Real-world examples from basic usage to production deployments.
๐ฏ Why Choose MLFCrafter?¶
Production Ready
MLFCrafter is built with production in mind - comprehensive logging, error handling, and testing ensure reliability.
Developer Friendly
Intuitive API design with clear documentation and helpful error messages make development fast and enjoyable.
Extensible
Create custom crafters easily by following the simple interface pattern.
Well Tested
23 comprehensive tests ensure quality and reliability across all components.
๐ค Community & Support¶
- GitHub: brkcvlk/mlfcrafter
- Issues: Report bugs or request features
- Discussions: Ask questions and share ideas
- PyPI: mlfcrafter package