๐ค Machine Learning Model
Agent-guided ML pipeline framework with PyQt6 GUI, experiment tracking, and production-ready model automation.
Table of Contents
Overview
Machine Learning Model is a comprehensive, agent-driven ML framework that automates the full machine learning lifecycle โ from raw data ingestion to production model deployment โ through a 13-step guided pipeline. It targets data scientists, ML engineers, and developers who want structured, reproducible ML workflows without sacrificing flexibility.
The framework pairs a PyQt6 graphical interface with an intelligent ML agent that provides context-aware recommendations at every pipeline stage. Traditional algorithm exploration and AI-guided automation coexist in a single, unified environment.
[!IMPORTANT]
Agent Mode is the primary workflow entry point. It guides you step-by-step through the entire ML pipeline with automatic state persistence so you can pause and resume at any stage.
(back to top โ)
Key Features
| Icon |
Feature |
Description |
Impact |
Status |
| ๐ค |
ML Agent |
AI-powered assistant navigating the 13-step pipeline |
Critical |
โ
Stable |
| ๐ฅ๏ธ |
PyQt6 GUI |
Interactive workflow navigator with real-time progress |
High |
โ
Stable |
| ๐พ |
State Persistence |
Auto save/load of workflow progress across sessions |
High |
โ
Stable |
| ๐ |
Enhanced Results |
Execution timing, hyperparameters, smart recommendations |
High |
โ
Stable |
| ๐งช |
MLflow Tracking |
Experiment logging: params, metrics, feature importances |
Medium |
โ
Stable |
| ๐๏ธ |
DVC Versioning |
Reproducible data & model pipelines via DVC |
Medium |
โ
Stable |
| ๐ณ |
Docker Support |
GUI-in-container with X11 forwarding and font rendering |
Medium |
โ
Stable |
| โ๏ธ |
Hyperparameter Tuning |
Automated optimization integrated into pipeline |
High |
๐ก Beta |
| ๐ก |
Drift Monitoring |
Continuous learning and model drift detection |
Medium |
๐ก Beta |
Highlights:
- 13-step automated pipeline: Data Collection โ Preprocessing โ EDA โ Feature Engineering โ Splitting โ Algorithm Selection โ Training โ Evaluation โ Tuning โ Deployment โ Monitoring โ Experiment Tracking โ Data Versioning
- Rich algorithm output: every algorithm run returns execution time, full hyperparameter config, performance category (Excellent/Good/Fair/Poor), and actionable recommendations
- Cross-platform: Linux, Windows, and basic macOS support with both shell and batch launchers
(back to top โ)
Architecture
System Architecture
flowchart TD
User([๐ค User]) --> Entry{Entry Point}
Entry -->|Agent Mode| Agent[๐ค ML Agent\nml_agent.py]
Entry -->|GUI Mode| GUI[๐ฅ๏ธ PyQt6 GUI\nmain_window_pyqt6.py]
Entry -->|CLI Mode| CLI[โจ๏ธ CLI\ncli.py]
Agent --> Workflow[๐ ML Workflow\nml_workflow.py]
GUI --> Workflow
Workflow --> Steps[๐ง Step Implementations\nstep_implementations.py]
Steps --> DataLayer[๐ฆ Data Layer]
DataLayer --> Loader[Data Loader]
DataLayer --> Validator[Data Validator]
Steps --> Supervised[๐ฒ Supervised Algorithms]
Supervised --> DT[Decision Tree]
Supervised --> RF[Random Forest]
Supervised --> SKLearn[scikit-learn Suite]
Steps --> Eval[๐ Evaluation\nMetrics & Reports]
Steps --> Track[๐งช MLflow Tracking]
Steps --> DVC[๐๏ธ DVC Versioning]
Eval --> Results[EnhancedResult\nTiming + Recommendations]
Results --> Viz[๐ Visualization\nmatplotlib / plotly]
Component Responsibilities
| Component |
Location |
Responsibility |
ML Agent |
workflow/ml_agent.py |
Orchestrates pipeline steps, provides context-aware recommendations |
ML Workflow |
workflow/ml_workflow.py |
State machine managing 13-step progression and persistence |
Step Implementations |
workflow/step_implementations.py |
Concrete logic for each pipeline stage |
PyQt6 GUI |
gui/main_window_pyqt6.py |
Interactive dashboard, progress tracking, real-time output |
CLI |
cli.py |
Typer-based command-line interface |
Supervised |
supervised/ |
Decision Tree, Random Forest with enhanced result output |
Tracking |
tracking/ |
MLflow integration for experiment logging |
Visualization |
visualization/ |
matplotlib, seaborn, plotly chart generation |
[!NOTE]
All pipeline state is automatically serialized to disk so sessions survive crashes or intentional exits. Resume by re-launching โ the agent picks up where you left off.
(back to top โ)
Usage Flow
End-to-End Interaction Sequence
sequenceDiagram
participant Dev as ๐ค Developer
participant GUI as ๐ฅ๏ธ PyQt6 GUI
participant Agent as ๐ค ML Agent
participant Pipeline as ๐ Workflow
participant MLflow as ๐งช MLflow
participant DVC as ๐๏ธ DVC
Dev->>GUI: Launch application
GUI->>Agent: Initialize agent session
Agent->>Pipeline: Load or create workflow state
Pipeline-->>Agent: Current step (e.g. Step 1: Data Collection)
Agent-->>GUI: Display step + recommendations
Dev->>GUI: Load dataset
GUI->>Pipeline: execute_step(data_collection)
Pipeline->>DVC: Track raw data file
DVC-->>Pipeline: โ
data versioned
Pipeline-->>GUI: Step complete โ advance to Step 2
Dev->>GUI: Run model training (Step 7)
GUI->>Pipeline: execute_step(model_training)
Pipeline->>MLflow: log_params(), log_metrics()
MLflow-->>Pipeline: Run ID logged
Pipeline-->>GUI: EnhancedResult{timing, metrics, recommendations}
GUI-->>Dev: Display results + performance category
(back to top โ)
Algorithm Coverage
Supported Algorithm Distribution
pie title Algorithm Coverage by Category
"Supervised Classification" : 40
"Supervised Regression" : 30
"Ensemble Methods" : 20
"Unsupervised (planned)" : 10
| Category |
Algorithms |
Status |
| Supervised Classification |
Decision Tree, Random Forest, SVM, KNN, Logistic Regression |
โ
Stable |
| Supervised Regression |
Linear Regression, Decision Tree Regressor, Random Forest Regressor |
โ
Stable |
| Ensemble Methods |
Random Forest, XGBoost, LightGBM |
โ
Stable |
| Unsupervised Clustering |
K-Means, DBSCAN |
๐ก Planned |
| Neural Networks |
scikit-learn MLPClassifier |
๐ก Planned |
(back to top โ)
Technology Stack
| Technology |
Purpose |
Why Chosen |
Alternatives Considered |
| Python 3.8+ |
Core runtime |
Ubiquitous ML ecosystem, broad OS support |
Julia, R |
| scikit-learn |
ML algorithms |
Battle-tested, consistent API, rich estimator library |
PyTorch, TensorFlow |
| XGBoost / LightGBM |
Gradient boosting |
State-of-the-art tabular performance |
CatBoost |
| PyQt6 |
Desktop GUI |
Native look/feel, rich widget set, Linux/Win/Mac |
Tkinter, Dear PyGui |
| MLflow |
Experiment tracking |
Self-hostable, rich UI, scikit-learn autolog |
Weights & Biases, Neptune |
| DVC |
Data versioning |
Git-native, storage-agnostic, pipeline support |
LakeFS, Pachyderm |
| Docker |
Containerization |
Reproducible GUI environment, CI isolation |
Podman |
| pytest |
Testing |
Fixture system, coverage plugins, hypothesis |
unittest |
| loguru |
Logging |
Structured logs, rotation, zero-boilerplate |
standard logging |
| Typer + Rich |
CLI |
Auto-help generation, colored output |
Click, argparse |
(back to top โ)
Setup & Installation
Prerequisites
- Python 3.8 โ 3.12
- Git
- Docker (optional, for containerized GUI)
- A display server (X11 or Wayland for GUI)
Clone & Install
git clone https://github.com/hkevin01/Machine-Learning-Model.git
cd Machine-Learning-Model
Linux / macOS:
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Dev + ML + viz extras
pip install -r requirements-dev.txt
Windows:
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
Environment Variables
Copy the example environment file and configure as needed:
cp .env.example .env
# .env
MLFLOW_TRACKING_URI=http://localhost:5000
MLFLOW_EXPERIMENT_NAME=default
Verify Setup
python scripts/validate_setup.py
[!TIP]
Run make mlflow-ui after installing dev dependencies to open the MLflow experiment dashboard at http://localhost:5000.
(back to top โ)
Usage
Option 1 โ Agent Mode (Recommended)
# Linux / macOS
./run_agent.sh
# Windows
run_agent.bat
The agent launches an interactive CLI + GUI session and guides you through all 13 pipeline steps.
Option 2 โ PyQt6 GUI
# Unified launcher (Docker or local)
./run.sh # Launch GUI in Docker
./run.sh --local # Launch GUI natively
./run.sh --headless # Headless import smoke-test
./run.sh --rebuild # Force rebuild Docker image
./run.sh --healthcheck # Environment & ML diagnostics
Option 3 โ CLI
python -m machine_learning_model --help
Option 4 โ Python API
from machine_learning_model.workflow.ml_agent import MLAgent
agent = MLAgent()
agent.run() # Starts the guided 13-step pipeline
Enhanced Algorithm Output:
from machine_learning_model.supervised.random_forest import run_algorithm
result = run_algorithm("Random Forest", "classification", spec)
print(f"Execution Time : {result.execution_time:.4f}s")
print(f"Performance : {result.performance_summary}") # "Accuracy: 0.934 (Excellent)"
print(f"Recommendations: {result.recommendations}") # ["Try cross-validation", ...]
(back to top โ)
Core Capabilities
๐ค Agent Mode Pipeline
The ML Agent executes a deterministic 13-step workflow. Each step is independently resumable:
| # |
Step |
Description |
| 1 |
Data Collection |
Automated dataset loading and schema validation |
| 2 |
Data Preprocessing |
Cleaning, null handling, encoding, type coercion |
| 3 |
Exploratory Data Analysis |
Automated statistical summary and distribution plots |