# chandanc5525/compositecementstrength_predictionmodel architecture

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

- Interactive diagram: https://gitdiagram.com/chandanc5525/compositecementstrength_predictionmodel
- Repository: https://github.com/chandanc5525/compositecementstrength_predictionmodel

## Overview

This repository contains a concrete-strength prediction system: a training workflow selects and saves a regression model, and a FastAPI application serves predictions through a form or JSON endpoint. The README describes a scaffolding tool, but no generator implementation appears in the supplied tree or sampled source; the diagram therefore maps the implemented prediction system. Training and serving use distinct preprocessing paths, so their scaler compatibility is not established by the excerpts.

Main entry points: [`main.py`](https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/main.py) (Training entry), [`src/data_ingestion.py`](https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/src/data_ingestion.py) (Data ingestion), [`src/data_preprocessing.py`](https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/src/data_preprocessing.py) (Split and scale), [`app/main.py`](https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/app/main.py) (FastAPI routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Model training"]
  node_train_entry["Training entry<br/>[main.py]"]
  node_ingestion["Data ingestion<br/>[data_ingestion.py]"]
  node_preprocessing["Split and scale"]
  node_builder["Model candidates<br/>[model_builder.py]"]
  node_evaluator["Model evaluation<br/>[model_evaluator.py]"]
  node_model_saver["Model persistence<br/>[model_predictor.py]"]
end

subgraph group_serving["Prediction service"]
  node_api["FastAPI routes<br/>[main.py]"]
  node_input_schema["Prediction input<br/>[schemas.py]"]
  node_web_page["Prediction form<br/>[main.html]"]
  node_prediction_service["Prediction service<br/>[service.py]"]
end

subgraph group_assets["Data and artifacts"]
  node_raw_data["Concrete dataset<br/>[Concrete_Data.csv]"]
  node_params["Training parameters<br/>[params.yaml]"]
  node_model_artifact["Selected model<br/>[best_model.pkl]"]
  node_scaler_artifact["Training scaler<br/>[scaler.pkl]"]
end

node_engineer(("ML engineer"))
node_consumer(("Prediction user"))

node_engineer -->|"runs training"| node_train_entry
node_train_entry -->|"loads data"| node_ingestion
node_ingestion -->|"reads settings"| node_params
node_ingestion -->|"reads dataset"| node_raw_data
node_ingestion -->|"returns data"| node_train_entry
node_train_entry -->|"prepares data"| node_preprocessing
node_preprocessing -->|"reads settings"| node_params
node_preprocessing -->|"writes scaler"| node_scaler_artifact
node_preprocessing -->|"returns splits"| node_train_entry
node_train_entry -->|"builds candidates"| node_builder
node_builder -->|"returns candidates"| node_train_entry
node_train_entry -->|"evaluates candidate"| node_evaluator
node_evaluator -->|"returns metrics"| node_train_entry
node_train_entry -->|"saves winner"| node_model_saver
node_model_saver -->|"writes model"| node_model_artifact
node_consumer -->|"requests prediction"| node_api
node_api -->|"renders form"| node_web_page
node_api -->|"constructs input"| node_input_schema
node_api -->|"requests prediction"| node_prediction_service
node_prediction_service -->|"loads model"| node_model_artifact
node_prediction_service -->|"loads scaler"| node_scaler_artifact
node_prediction_service -->|"returns strength"| node_consumer

click node_train_entry "https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/main.py"
click node_ingestion "https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/src/data_ingestion.py"
click node_preprocessing "https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/src/data_preprocessing.py"
click node_builder "https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/src/model_builder.py"
click node_evaluator "https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/src/model_evaluator.py"
click node_model_saver "https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/src/model_predictor.py"
click node_raw_data "https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/data/raw/Concrete_Data.csv"
click node_params "https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/params.yaml"
click node_model_artifact "https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/models/best_model.pkl"
click node_scaler_artifact "https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/models/scaler.pkl"
click node_api "https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/app/main.py"
click node_input_schema "https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/app/schemas.py"
click node_web_page "https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/app/templates/main.html"
click node_prediction_service "https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/app/service.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_train_entry,node_ingestion,node_preprocessing,node_builder,node_evaluator,node_model_saver,node_consumer toneBlue
class node_api,node_input_schema,node_web_page,node_prediction_service toneAmber
class node_raw_data,node_params,node_model_artifact,node_scaler_artifact toneMint
class node_engineer toneIndigo
```

## Components

### Model training

- [Training entry](https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/main.py): `main.py`
- [Data ingestion](https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/src/data_ingestion.py): `src/data_ingestion.py`
- [Split and scale](https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/src/data_preprocessing.py): `src/data_preprocessing.py`
- [Model candidates](https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/src/model_builder.py): `src/model_builder.py`
- [Model evaluation](https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/src/model_evaluator.py): `src/model_evaluator.py`
- [Model persistence](https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/src/model_predictor.py): `src/model_predictor.py`

### Prediction service

- [FastAPI routes](https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/app/main.py): `app/main.py`
- [Prediction input](https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/app/schemas.py): `app/schemas.py`
- [Prediction form](https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/app/templates/main.html): `app/templates/main.html`
- [Prediction service](https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/app/service.py): `app/service.py`

### Data and artifacts

- [Concrete dataset](https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/data/raw/Concrete_Data.csv): `data/raw/Concrete_Data.csv`
- [Training parameters](https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/params.yaml): `params.yaml`
- [Selected model](https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/models/best_model.pkl): `models/best_model.pkl`
- [Training scaler](https://github.com/chandanc5525/compositecementstrength_predictionmodel/blob/main/models/scaler.pkl): `models/scaler.pkl`

### Other components

- **ML engineer**
- **Prediction user**

## Connections

- ML engineer → Training entry: runs training
- Training entry → Data ingestion: loads data
- Data ingestion → Training parameters: reads settings
- Data ingestion → Concrete dataset: reads dataset
- Data ingestion → Training entry: returns data
- Training entry → Split and scale: prepares data
- Split and scale → Training parameters: reads settings
- Split and scale → Training scaler: writes scaler
- Split and scale → Training entry: returns splits
- Training entry → Model candidates: builds candidates
- Model candidates → Training entry: returns candidates
- Training entry → Model evaluation: evaluates candidate
- Model evaluation → Training entry: returns metrics
- Training entry → Model persistence: saves winner
- Model persistence → Selected model: writes model
- Prediction user → FastAPI routes: requests prediction
- FastAPI routes → Prediction form: renders form
- FastAPI routes → Prediction input: constructs input
- FastAPI routes → Prediction service: requests prediction
- Prediction service → Selected model: loads model
- Prediction service → Training scaler: loads scaler
- Prediction service → Prediction user: returns strength
