# krishnaik06/mlprojecthindi architecture

> Architecture diagram of the GitHub repository krishnaik06/mlprojecthindi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/krishnaik06/mlprojecthindi
- Repository: https://github.com/krishnaik06/mlprojecthindi

## Overview

#### Purpose and Entry Points
This is an end-to-end Python ML project for student-performance prediction, covering dataset ingestion, feature preparation, model training/evaluation, experiment tracking, and inference. Primary runnable entry points are `main.py` and `app.py`; orchestration logic is organized under `src/mlproject/pipelines/training_pipeline.py` and `src/mlproject/pipelines/prediction_pipeline.py`.

#### Training Orchestration
The training pipeline coordinates the sequential ML lifecycle: acquire data, transform it, fit/select a model, and persist outputs. Its core boundary is between reusable pipeline orchestration and stage implementations:
- `src/mlproject/pipelines/training_pipeline.py`
- `src/mlproject/components/data_ingestion.py`
- `src/mlproject/components/model_tranier.py`

#### Data Ingestion and Versioned Dataset Boundary
Ingestion produces local train/test CSV artifacts from the raw dataset. DVC tracks the raw input rather than embedding its content in Git, making `artifacts/raw.csv.dvc` the dataset-version reference. Generated datasets are materialized under `artifacts/`.
- `src/mlproject/components/data_ingestion.py`
- `artifacts/raw.csv.dvc`
- `artifacts/train.csv`

#### Feature Transformation and Artifact Contract
The transformation stage prepares raw tabular records for training and prediction and serializes the fitted preprocessing state. The saved preprocessor is a compatibility contract: serving must apply the same object used during model fitting.
- `src/mlproject/components/data_transformation.py`
- `artifacts/preprocessor.pkl`
- `src/mlproject/pipelines/prediction_pipeline.py`

#### Model Training, Evaluation, and Persistence
Model training consumes transformed train/test data, evaluates regression quality, and writes the selected model artifact. CatBoost training outputs indicate CatBoost is a material model runtime/dependency. The inference path should load the paired model and preprocessor from `artifacts/`.
- `src/mlproject/components/model_tranier.py`
- `artifacts/model.pkl`
- `catboost_info/catboost_training.json`

#### Prediction / Application Boundary
The prediction pipeline isolates artifact loading and scoring from model development. `app.py` is the likely user-facing serving entry point, while `main.py` likely invokes the packaged training workflow; both sit above pipeline modules rather than directly owning preprocessing or model logic.
- `app.py`
- `main.py`
- `src/mlproject/pipelines/prediction_pipeline.py`

#### Experiment Tracking and Monitoring
MLflow records run metadata, regression metrics (MAE, R², RMSE), and serialized model packages under local `mlruns/`. The README also configures an external MLflow tracking URI hosted by DagsHub, so training can be redirected from local filesystem tracking to that remote service. A monitoring component exists as a separate lifecycle concern.
- `src/mlproject/components/model_monitering.py`
- `mlruns/0/3c40c261ea9f4847a3e7044072cd205c/metrics/rmse`
- `mlruns/0/3c40c261ea9f4847a3e7044072cd205c/artifacts/model/MLmodel`

#### Packaging and Runtime
The project is packaged as `mlproject` using a `src/` layout. It runs in Python, with dependency declarations and a Docker build definition supporting reproducible execution. Notebooks are exploratory/training-history assets, separate from the production pipeline.
- `setup.py`
- `requirements.txt`
- `Dockerfile`

Main entry points: [`src/mlproject/components/model_tranier.py`](https://github.com/krishnaik06/mlprojecthindi/blob/main/src/mlproject/components/model_tranier.py) (Model Training), [`src/mlproject/pipelines/training_pipeline.py`](https://github.com/krishnaik06/mlprojecthindi/blob/main/src/mlproject/pipelines/training_pipeline.py) (Training Pipeline), [`src/mlproject/components/data_transformation.py`](https://github.com/krishnaik06/mlprojecthindi/blob/main/src/mlproject/components/data_transformation.py) (Data Transformation), [`artifacts/preprocessor.pkl`](https://github.com/krishnaik06/mlprojecthindi/blob/main/artifacts/preprocessor.pkl) (Fitted Preprocessor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry Points"]
  node_main["Training CLI<br/>Python entry point<br/>[main.py]"]
  node_app["Serving App<br/>Python entry point<br/>[app.py]"]
end

subgraph group_workflow["ML Workflow"]
  node_training_pipeline["Training Pipeline<br/>orchestrator"]
  node_prediction_pipeline["Prediction Pipeline<br/>inference workflow"]
  node_ingestion["Data Ingestion<br/>pipeline stage<br/>[data_ingestion.py]"]
  node_transformation["Data Transformation<br/>pipeline stage"]
  node_trainer["Model Training<br/>pipeline stage<br/>[model_tranier.py]"]
  node_monitoring["Model Monitoring<br/>lifecycle component"]
end

subgraph group_artifacts["Data, Artifacts &amp; Tracking"]
  node_raw_dvc["Versioned Raw Dataset<br/>DVC dataset reference<br/>[raw.csv.dvc]"]
  node_train_data["Materialized Train Data<br/>CSV artifact<br/>[train.csv]"]
  node_preprocessor["Fitted Preprocessor<br/>serialized artifact<br/>[preprocessor.pkl]"]
  node_model["Selected Model<br/>serialized artifact<br/>[model.pkl]"]
  node_catboost_output["CatBoost Training Output<br/>model runtime output"]
  node_mlflow[("MLflow Tracking<br/>experiment tracking")]
end

subgraph group_runtime["Packaging &amp; Runtime"]
  node_package["mlproject Package<br/>Python package<br/>[setup.py]"]
  node_dependencies["Python Dependencies<br/>dependency manifest<br/>[requirements.txt]"]
  node_docker["Container Build<br/>Docker runtime"]
end

node_main -->|"starts"| node_training_pipeline
node_app -->|"serves through"| node_prediction_pipeline
node_training_pipeline -->|"acquires data"| node_ingestion
node_training_pipeline -->|"prepares features"| node_transformation
node_training_pipeline -->|"fits and selects"| node_trainer
node_raw_dvc -->|"versions raw input"| node_ingestion
node_ingestion -->|"materializes"| node_train_data
node_train_data -->|"input records"| node_transformation
node_transformation -->|"serializes"| node_preprocessor
node_transformation -->|"transformed data"| node_trainer
node_preprocessor -->|"fitted feature contract"| node_trainer
node_trainer -->|"persists selected model"| node_model
node_trainer -->|"emits training output"| node_catboost_output
node_trainer -->|"logs metrics and model"| node_mlflow
node_mlflow -.->|"run data"| node_monitoring
node_model -->|"loads"| node_prediction_pipeline
node_preprocessor -->|"loads"| node_prediction_pipeline
node_dependencies -->|"installs runtime"| node_package
node_docker -->|"packages execution"| node_package

click node_main "https://github.com/krishnaik06/mlprojecthindi/blob/main/main.py"
click node_app "https://github.com/krishnaik06/mlprojecthindi/blob/main/app.py"
click node_training_pipeline "https://github.com/krishnaik06/mlprojecthindi/blob/main/src/mlproject/pipelines/training_pipeline.py"
click node_prediction_pipeline "https://github.com/krishnaik06/mlprojecthindi/blob/main/src/mlproject/pipelines/prediction_pipeline.py"
click node_ingestion "https://github.com/krishnaik06/mlprojecthindi/blob/main/src/mlproject/components/data_ingestion.py"
click node_transformation "https://github.com/krishnaik06/mlprojecthindi/blob/main/src/mlproject/components/data_transformation.py"
click node_trainer "https://github.com/krishnaik06/mlprojecthindi/blob/main/src/mlproject/components/model_tranier.py"
click node_monitoring "https://github.com/krishnaik06/mlprojecthindi/blob/main/src/mlproject/components/model_monitering.py"
click node_raw_dvc "https://github.com/krishnaik06/mlprojecthindi/blob/main/artifacts/raw.csv.dvc"
click node_train_data "https://github.com/krishnaik06/mlprojecthindi/blob/main/artifacts/train.csv"
click node_preprocessor "https://github.com/krishnaik06/mlprojecthindi/blob/main/artifacts/preprocessor.pkl"
click node_model "https://github.com/krishnaik06/mlprojecthindi/blob/main/artifacts/model.pkl"
click node_catboost_output "https://github.com/krishnaik06/mlprojecthindi/blob/main/catboost_info/catboost_training.json"
click node_mlflow "https://github.com/krishnaik06/mlprojecthindi/blob/main/mlruns/0/3c40c261ea9f4847a3e7044072cd205c/metrics/rmse"
click node_package "https://github.com/krishnaik06/mlprojecthindi/blob/main/setup.py"
click node_dependencies "https://github.com/krishnaik06/mlprojecthindi/blob/main/requirements.txt"
click node_docker "https://github.com/krishnaik06/mlprojecthindi/blob/main/Dockerfile"

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_main,node_app toneBlue
class node_training_pipeline,node_prediction_pipeline,node_ingestion,node_transformation,node_trainer,node_monitoring toneAmber
class node_raw_dvc,node_train_data,node_preprocessor,node_model,node_catboost_output,node_mlflow toneMint
class node_package,node_dependencies,node_docker toneRose
```

## Components

### Entry Points

- [Training CLI](https://github.com/krishnaik06/mlprojecthindi/blob/main/main.py): Python entry point · Starts the packaged training workflow. · `main.py`
- [Serving App](https://github.com/krishnaik06/mlprojecthindi/blob/main/app.py): Python entry point · User-facing prediction entry point. · `app.py`

### ML Workflow

- [Training Pipeline](https://github.com/krishnaik06/mlprojecthindi/blob/main/src/mlproject/pipelines/training_pipeline.py): orchestrator · Coordinates ingestion, transformation, and model selection. · `src/mlproject/pipelines/training_pipeline.py`
- [Prediction Pipeline](https://github.com/krishnaik06/mlprojecthindi/blob/main/src/mlproject/pipelines/prediction_pipeline.py): inference workflow · Loads paired artifacts and scores records. · `src/mlproject/pipelines/prediction_pipeline.py`
- [Data Ingestion](https://github.com/krishnaik06/mlprojecthindi/blob/main/src/mlproject/components/data_ingestion.py): pipeline stage · Materializes local train/test data from the versioned raw dataset. · `src/mlproject/components/data_ingestion.py`
- [Data Transformation](https://github.com/krishnaik06/mlprojecthindi/blob/main/src/mlproject/components/data_transformation.py): pipeline stage · Fits and applies tabular preprocessing. · `src/mlproject/components/data_transformation.py`
- [Model Training](https://github.com/krishnaik06/mlprojecthindi/blob/main/src/mlproject/components/model_tranier.py): pipeline stage · Evaluates candidates and persists the selected regressor. · `src/mlproject/components/model_tranier.py`
- [Model Monitoring](https://github.com/krishnaik06/mlprojecthindi/blob/main/src/mlproject/components/model_monitering.py): lifecycle component · `src/mlproject/components/model_monitering.py`

### Data, Artifacts & Tracking

- [Versioned Raw Dataset](https://github.com/krishnaik06/mlprojecthindi/blob/main/artifacts/raw.csv.dvc): DVC dataset reference · Raw input is versioned outside Git content. · `artifacts/raw.csv.dvc`
- [Materialized Train Data](https://github.com/krishnaik06/mlprojecthindi/blob/main/artifacts/train.csv): CSV artifact · `artifacts/train.csv`
- [Fitted Preprocessor](https://github.com/krishnaik06/mlprojecthindi/blob/main/artifacts/preprocessor.pkl): serialized artifact · Compatibility contract shared by training and serving. · `artifacts/preprocessor.pkl`
- [Selected Model](https://github.com/krishnaik06/mlprojecthindi/blob/main/artifacts/model.pkl): serialized artifact · `artifacts/model.pkl`
- [CatBoost Training Output](https://github.com/krishnaik06/mlprojecthindi/blob/main/catboost_info/catboost_training.json): model runtime output · `catboost_info/catboost_training.json`
- [MLflow Tracking](https://github.com/krishnaik06/mlprojecthindi/blob/main/mlruns/0/3c40c261ea9f4847a3e7044072cd205c/metrics/rmse): experiment tracking · Records metrics and model packages locally or via configured remote tracking. · `mlruns/0/3c40c261ea9f4847a3e7044072cd205c/metrics/rmse`

### Packaging & Runtime

- [mlproject Package](https://github.com/krishnaik06/mlprojecthindi/blob/main/setup.py): Python package · src-layout project package. · `setup.py`
- [Python Dependencies](https://github.com/krishnaik06/mlprojecthindi/blob/main/requirements.txt): dependency manifest · Includes the ML runtime dependencies. · `requirements.txt`
- [Container Build](https://github.com/krishnaik06/mlprojecthindi/blob/main/Dockerfile): Docker runtime · Reproducible execution environment. · `Dockerfile`

## Connections

- Training CLI → Training Pipeline: starts
- Serving App → Prediction Pipeline: serves through
- Training Pipeline → Data Ingestion: acquires data
- Training Pipeline → Data Transformation: prepares features
- Training Pipeline → Model Training: fits and selects
- Versioned Raw Dataset → Data Ingestion: versions raw input
- Data Ingestion → Materialized Train Data: materializes
- Materialized Train Data → Data Transformation: input records
- Data Transformation → Fitted Preprocessor: serializes
- Data Transformation → Model Training: transformed data
- Fitted Preprocessor → Model Training: fitted feature contract
- Model Training → Selected Model: persists selected model
- Model Training → CatBoost Training Output: emits training output
- Model Training → MLflow Tracking: logs metrics and model
- MLflow Tracking → Model Monitoring: run data
- Selected Model → Prediction Pipeline: loads
- Fitted Preprocessor → Prediction Pipeline: loads
- Python Dependencies → mlproject Package: installs runtime
- Container Build → mlproject Package: packages execution
