# sadhana-panthi/freight-rate_ml architecture

> Architecture diagram of the GitHub repository sadhana-panthi/freight-rate_ml, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sadhana-panthi/freight-rate_ml
- Repository: https://github.com/sadhana-panthi/freight-rate_ml

## Overview

This repository is a freight-rate prediction workflow. Its primary path prepares training and scoring data, evaluates a time-based holdout, fits a gradient-boosted regression pipeline, and writes validation and December predictions. Separate analysis scripts compare models and features and report data-quality findings; the provided scorer validates deliverables and creates the December chart. The model’s preprocessing and target transformation are implemented inside the main prediction module. Edges reflect the shown calls and documented file handoffs; the CSV contents and unsampled runtime behavior are not inferred.

Main entry points: [`predict_rates.py`](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/predict_rates.py) (Feature preparation), [`compare_models.py`](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/compare_models.py) (Model comparison), [`score.py`](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/score.py) (Submission scorer), [`data_checks.py`](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/data_checks.py) (Data findings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Input data"]
  node_train_data["Training loads<br/>[train_test.csv]"]
  node_validation_data["Validation loads<br/>[validation.csv]"]
  node_december_inputs["December inputs"]
  node_template["ID template"]
end

subgraph group_prediction["Prediction workflow"]
  node_feature_prep["Feature preparation<br/>[predict_rates.py]"]
  node_holdout_eval["Holdout evaluation<br/>[predict_rates.py]"]
  node_model_pipeline["Regression pipeline<br/>[predict_rates.py]"]
  node_preprocessing["Impute and encode<br/>[predict_rates.py]"]
  node_hgb["Gradient boosting<br/>[predict_rates.py]"]
  node_prediction_writer["Prediction writer<br/>[predict_rates.py]"]
  node_validation_output["Validation predictions"]
  node_december_output["December predictions"]
end

subgraph group_analysis["Model analysis"]
  node_comparison["Model comparison<br/>[compare_models.py]"]
  node_feature_checks["Feature ablation<br/>[compare_models.py]"]
  node_data_checks["Data findings<br/>[data_checks.py]"]
end

subgraph group_checking["Output checks"]
  node_scorer["Submission scorer<br/>[score.py]"]
  node_chart["December chart"]
end

node_analyst(("Analyst"))

node_analyst -->|"runs"| node_prediction_writer
node_train_data -->|"reads"| node_feature_prep
node_validation_data -->|"reads"| node_feature_prep
node_december_inputs -->|"reads"| node_feature_prep
node_feature_prep -->|"prepares features"| node_holdout_eval
node_holdout_eval -->|"fits and evaluates"| node_model_pipeline
node_prediction_writer -->|"prepares features"| node_feature_prep
node_prediction_writer -->|"fits model"| node_model_pipeline
node_model_pipeline -->|"applies"| node_preprocessing
node_model_pipeline -->|"trains"| node_hgb
node_template -->|"supplies IDs"| node_prediction_writer
node_prediction_writer -->|"writes"| node_validation_output
node_prediction_writer -->|"writes"| node_december_output
node_analyst -->|"runs"| node_comparison
node_comparison -->|"uses"| node_feature_prep
node_comparison -->|"builds models"| node_model_pipeline
node_comparison -->|"computes variants"| node_feature_checks
node_analyst -->|"runs"| node_data_checks
node_data_checks -->|"uses"| node_feature_prep
node_data_checks -->|"evaluates errors"| node_model_pipeline
node_analyst -->|"runs"| node_scorer
node_validation_output -->|"validates"| node_scorer
node_december_output -->|"validates"| node_scorer
node_scorer -->|"creates"| node_chart

click node_train_data "https://github.com/sadhana-panthi/freight-rate_ml/blob/main/data/train_test.csv"
click node_validation_data "https://github.com/sadhana-panthi/freight-rate_ml/blob/main/data/validation.csv"
click node_december_inputs "https://github.com/sadhana-panthi/freight-rate_ml/blob/main/data/december_chart_inputs.csv"
click node_template "https://github.com/sadhana-panthi/freight-rate_ml/blob/main/data/validation_predictions_template.csv"
click node_feature_prep "https://github.com/sadhana-panthi/freight-rate_ml/blob/main/predict_rates.py"
click node_holdout_eval "https://github.com/sadhana-panthi/freight-rate_ml/blob/main/predict_rates.py"
click node_model_pipeline "https://github.com/sadhana-panthi/freight-rate_ml/blob/main/predict_rates.py"
click node_preprocessing "https://github.com/sadhana-panthi/freight-rate_ml/blob/main/predict_rates.py"
click node_hgb "https://github.com/sadhana-panthi/freight-rate_ml/blob/main/predict_rates.py"
click node_prediction_writer "https://github.com/sadhana-panthi/freight-rate_ml/blob/main/predict_rates.py"
click node_validation_output "https://github.com/sadhana-panthi/freight-rate_ml/blob/main/validation_predictions.csv"
click node_december_output "https://github.com/sadhana-panthi/freight-rate_ml/blob/main/december_predictions.csv"
click node_comparison "https://github.com/sadhana-panthi/freight-rate_ml/blob/main/compare_models.py"
click node_feature_checks "https://github.com/sadhana-panthi/freight-rate_ml/blob/main/compare_models.py"
click node_data_checks "https://github.com/sadhana-panthi/freight-rate_ml/blob/main/data_checks.py"
click node_scorer "https://github.com/sadhana-panthi/freight-rate_ml/blob/main/score.py"
click node_chart "https://github.com/sadhana-panthi/freight-rate_ml/tree/main/scorer_results"

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_data,node_validation_data,node_december_inputs,node_template toneBlue
class node_feature_prep,node_holdout_eval,node_model_pipeline,node_preprocessing,node_hgb,node_prediction_writer,node_validation_output,node_december_output toneAmber
class node_comparison,node_feature_checks,node_data_checks toneMint
class node_scorer,node_chart toneRose
class node_analyst toneIndigo
```

## Components

### Input data

- [Training loads](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/data/train_test.csv): `data/train_test.csv`
- [Validation loads](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/data/validation.csv): `data/validation.csv`
- [December inputs](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/data/december_chart_inputs.csv): `data/december_chart_inputs.csv`
- [ID template](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/data/validation_predictions_template.csv): `data/validation_predictions_template.csv`

### Prediction workflow

- [Feature preparation](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/predict_rates.py): `predict_rates.py`
- [Holdout evaluation](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/predict_rates.py): `predict_rates.py`
- [Regression pipeline](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/predict_rates.py): `predict_rates.py`
- [Impute and encode](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/predict_rates.py): `predict_rates.py`
- [Gradient boosting](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/predict_rates.py): `predict_rates.py`
- [Prediction writer](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/predict_rates.py): `predict_rates.py`
- [Validation predictions](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/validation_predictions.csv): `validation_predictions.csv`
- [December predictions](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/december_predictions.csv): `december_predictions.csv`

### Model analysis

- [Model comparison](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/compare_models.py): `compare_models.py`
- [Feature ablation](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/compare_models.py): `compare_models.py`
- [Data findings](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/data_checks.py): `data_checks.py`

### Output checks

- [Submission scorer](https://github.com/sadhana-panthi/freight-rate_ml/blob/main/score.py): `score.py`
- [December chart](https://github.com/sadhana-panthi/freight-rate_ml/tree/main/scorer_results): `scorer_results`

### Other components

- **Analyst**

## Connections

- Analyst → Prediction writer: runs (evidence: `README.md`)
- Training loads → Feature preparation: reads (evidence: `predict_rates.py`)
- Validation loads → Feature preparation: reads (evidence: `predict_rates.py`)
- December inputs → Feature preparation: reads (evidence: `predict_rates.py`)
- Feature preparation → Holdout evaluation: prepares features (evidence: `predict_rates.py`)
- Holdout evaluation → Regression pipeline: fits and evaluates (evidence: `predict_rates.py`)
- Prediction writer → Feature preparation: prepares features (evidence: `predict_rates.py`)
- Prediction writer → Regression pipeline: fits model (evidence: `predict_rates.py`)
- Regression pipeline → Impute and encode: applies (evidence: `predict_rates.py`)
- Regression pipeline → Gradient boosting: trains (evidence: `predict_rates.py`)
- ID template → Prediction writer: supplies IDs (evidence: `predict_rates.py`)
- Prediction writer → Validation predictions: writes (evidence: `predict_rates.py`)
- Prediction writer → December predictions: writes (evidence: `predict_rates.py`)
- Analyst → Model comparison: runs (evidence: `README.md`)
- Model comparison → Feature preparation: uses (evidence: `compare_models.py`)
- Model comparison → Regression pipeline: builds models (evidence: `compare_models.py`)
- Model comparison → Feature ablation: computes variants (evidence: `compare_models.py`)
- Analyst → Data findings: runs (evidence: `README.md`)
- Data findings → Feature preparation: uses (evidence: `data_checks.py`)
- Data findings → Regression pipeline: evaluates errors (evidence: `data_checks.py`)
- Analyst → Submission scorer: runs (evidence: `README.md`)
- Validation predictions → Submission scorer: validates (evidence: `README.md`)
- December predictions → Submission scorer: validates (evidence: `README.md`)
- Submission scorer → December chart: creates (evidence: `score.py`)
