# aabragan/automl-model-training architecture

> Architecture diagram of the GitHub repository aabragan/automl-model-training, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aabragan/automl-model-training
- Repository: https://github.com/aabragan/automl-model-training

## Overview

This is a Python AutoML training and prediction pipeline built on AutoGluon. Its main workflow takes a CSV through optional profiling and feature engineering, trains and evaluates models, then writes run artifacts for later prediction. Separate capabilities support backtesting, experiment comparison, and iterative training through an autonomous or LLM-driven agent. The graph follows documented workflows and sampled source; some subsystem wiring is omitted where implementation excerpts were unavailable.

Main entry points: [`src/automl_model_training/train.py`](https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/train.py) (Model training), [`src/automl_model_training/predict.py`](https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/predict.py) (Prediction), [`src/automl_model_training/run_artifacts.py`](https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/run_artifacts.py) (Run artifacts), [`src/automl_model_training/agent.py`](https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/agent.py) (Autonomous training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data_prep["Data preparation"]
  node_profile["Dataset profiling<br/>[profile.py]"]
  node_data["Load and split data<br/>[data.py]"]
  node_features["Feature transforms"]
end

subgraph group_modeling["Training and evaluation"]
  node_train["Model training<br/>[train.py]"]
  node_evaluation["Evaluation and analysis"]
  node_explain["SHAP explanations<br/>[explain.py]"]
  node_prune["Ensemble pruning<br/>[prune.py]"]
end

subgraph group_inference["Prediction and backtesting"]
  node_predict["Prediction<br/>[predict.py]"]
  node_drift["Drift detection<br/>[drift.py]"]
  node_backtest["Temporal backtesting<br/>[backtest.py]"]
end

subgraph group_automation["Agents and tools"]
  node_agent["Autonomous training<br/>[agent.py]"]
  node_ollama_agent["Ollama agent<br/>[ollama_agent.py]"]
  node_tool_layer["Agent tool layer"]
end

subgraph group_runs["Run management"]
  node_experiments["Experiment tracking<br/>[experiment.py]"]
  node_compare["Run comparison<br/>[compare.py]"]
  node_artifacts[("Run artifacts<br/>[run_artifacts.py]")]
end

node_user(("User"))
node_csv["CSV dataset"]
node_autogluon["AutoGluon"]
node_ollama["Ollama service"]

node_user -->|"provides"| node_csv
node_user -->|"requests profile"| node_profile
node_profile -->|"analyzes"| node_csv
node_user -->|"requests transforms"| node_features
node_features -->|"reads"| node_csv
node_features -->|"engineered CSV"| node_train
node_user -->|"starts training"| node_train
node_train -->|"loads and splits"| node_data
node_data -->|"reads"| node_csv
node_train -->|"trains models"| node_autogluon
node_train -->|"evaluates run"| node_evaluation
node_train -->|"generates explanations"| node_explain
node_train -.->|"may prune models"| node_prune
node_train -->|"writes run outputs"| node_artifacts
node_user -->|"requests predictions"| node_predict
node_predict -->|"loads model and predicts"| node_autogluon
node_predict -.->|"may check drift"| node_drift
node_predict -->|"writes outputs"| node_artifacts
node_user -->|"starts backtest"| node_backtest
node_backtest -->|"runs temporal training"| node_train
node_backtest -->|"writes results"| node_artifacts
node_user -->|"starts iteration"| node_agent
node_agent -->|"profiles data"| node_profile
node_agent -->|"trains candidate"| node_train
node_agent -->|"reviews results"| node_evaluation
node_ollama_agent -.->|"requests tool calls"| node_ollama
node_ollama_agent -->|"dispatches tools"| node_tool_layer
node_tool_layer -->|"runs training tools"| node_train
node_tool_layer -->|"applies transforms"| node_features
node_tool_layer -->|"runs prediction tools"| node_predict
node_user -->|"starts LLM workflow"| node_ollama_agent
node_user -->|"lists runs"| node_experiments
node_experiments -->|"records run data"| node_artifacts
node_user -->|"compares runs"| node_compare
node_compare -->|"reads run data"| node_artifacts

click node_profile "https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/profile.py"
click node_data "https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/data.py"
click node_features "https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/feature_engineering.py"
click node_train "https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/train.py"
click node_evaluation "https://github.com/aabragan/automl-model-training/tree/main/src/automl_model_training/evaluate"
click node_explain "https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/evaluate/explain.py"
click node_prune "https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/evaluate/prune.py"
click node_predict "https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/predict.py"
click node_drift "https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/drift.py"
click node_backtest "https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/backtest.py"
click node_agent "https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/agent.py"
click node_ollama_agent "https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/ollama_agent.py"
click node_tool_layer "https://github.com/aabragan/automl-model-training/tree/main/src/automl_model_training/tools"
click node_experiments "https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/experiment.py"
click node_compare "https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/compare.py"
click node_artifacts "https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/run_artifacts.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_profile,node_data,node_features,node_user toneBlue
class node_train,node_evaluation,node_explain,node_prune toneAmber
class node_predict,node_drift,node_backtest toneMint
class node_agent,node_ollama_agent,node_tool_layer toneRose
class node_experiments,node_compare,node_artifacts,node_csv,node_autogluon,node_ollama toneIndigo
```

## Components

### Data preparation

- [Dataset profiling](https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/profile.py): `src/automl_model_training/profile.py`
- [Load and split data](https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/data.py): `src/automl_model_training/data.py`
- [Feature transforms](https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/feature_engineering.py): `src/automl_model_training/feature_engineering.py`

### Training and evaluation

- [Model training](https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/train.py): `src/automl_model_training/train.py`
- [Evaluation and analysis](https://github.com/aabragan/automl-model-training/tree/main/src/automl_model_training/evaluate): `src/automl_model_training/evaluate`
- [SHAP explanations](https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/evaluate/explain.py): `src/automl_model_training/evaluate/explain.py`
- [Ensemble pruning](https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/evaluate/prune.py): `src/automl_model_training/evaluate/prune.py`

### Prediction and backtesting

- [Prediction](https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/predict.py): `src/automl_model_training/predict.py`
- [Drift detection](https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/drift.py): `src/automl_model_training/drift.py`
- [Temporal backtesting](https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/backtest.py): `src/automl_model_training/backtest.py`

### Agents and tools

- [Autonomous training](https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/agent.py): `src/automl_model_training/agent.py`
- [Ollama agent](https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/ollama_agent.py): `src/automl_model_training/ollama_agent.py`
- [Agent tool layer](https://github.com/aabragan/automl-model-training/tree/main/src/automl_model_training/tools): `src/automl_model_training/tools`

### Run management

- [Experiment tracking](https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/experiment.py): `src/automl_model_training/experiment.py`
- [Run comparison](https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/compare.py): `src/automl_model_training/compare.py`
- [Run artifacts](https://github.com/aabragan/automl-model-training/blob/main/src/automl_model_training/run_artifacts.py): `src/automl_model_training/run_artifacts.py`

### Other components

- **User**
- **CSV dataset**
- **AutoGluon**
- **Ollama service**

## Connections

- User → CSV dataset: provides
- User → Dataset profiling: requests profile
- Dataset profiling → CSV dataset: analyzes
- User → Feature transforms: requests transforms
- Feature transforms → CSV dataset: reads
- Feature transforms → Model training: engineered CSV
- User → Model training: starts training
- Model training → Load and split data: loads and splits
- Load and split data → CSV dataset: reads
- Model training → AutoGluon: trains models
- Model training → Evaluation and analysis: evaluates run
- Model training → SHAP explanations: generates explanations
- Model training → Ensemble pruning: may prune models
- Model training → Run artifacts: writes run outputs
- User → Prediction: requests predictions
- Prediction → AutoGluon: loads model and predicts
- Prediction → Drift detection: may check drift
- Prediction → Run artifacts: writes outputs
- User → Temporal backtesting: starts backtest
- Temporal backtesting → Model training: runs temporal training
- Temporal backtesting → Run artifacts: writes results
- User → Autonomous training: starts iteration
- Autonomous training → Dataset profiling: profiles data
- Autonomous training → Model training: trains candidate
- Autonomous training → Evaluation and analysis: reviews results
- Ollama agent → Ollama service: requests tool calls
- Ollama agent → Agent tool layer: dispatches tools
- Agent tool layer → Model training: runs training tools
- Agent tool layer → Feature transforms: applies transforms
- Agent tool layer → Prediction: runs prediction tools
- User → Ollama agent: starts LLM workflow
- User → Experiment tracking: lists runs
- Experiment tracking → Run artifacts: records run data
- User → Run comparison: compares runs
- Run comparison → Run artifacts: reads run data
