# joshwen7947/machine-learning-pipeline architecture

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

- Interactive diagram: https://gitdiagram.com/joshwen7947/machine-learning-pipeline
- Repository: https://github.com/joshwen7947/machine-learning-pipeline

## Overview

This is a small, single-script scikit-learn workflow for predicting vehicle CO₂ emissions. It reads a CSV, separates features and target, preprocesses numerical and categorical columns, trains and evaluates a random-forest regressor, saves the fitted pipeline, and displays evaluation plots. The stages are all implemented in one file; the edges reflect the calls and data flow visible there. The README gives no additional product capabilities, and the repository does not show how the script is launched.

Main entry points: [`ML_pipeline/pipeline.py`](https://github.com/joshwen7947/machine-learning-pipeline/blob/main/ML_pipeline/pipeline.py) (Pipeline script), [`ML_pipeline/vehicle_emissions.csv`](https://github.com/joshwen7947/machine-learning-pipeline/blob/main/ML_pipeline/vehicle_emissions.csv) (Emissions CSV)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Input data"]
  node_csv["Emissions CSV"]
end

subgraph group_model["Model workflow"]
  node_workflow["Pipeline script<br/>[pipeline.py]"]
  node_features["Feature preparation<br/>[pipeline.py]"]
  node_preprocessing["Preprocessing<br/>[pipeline.py]"]
  node_training["Model training<br/>[pipeline.py]"]
end

subgraph group_outputs["Results"]
  node_evaluation["Evaluation metrics<br/>[pipeline.py]"]
  node_artifact["Saved pipeline<br/>[pipeline.py]"]
  node_plots["Evaluation plots<br/>[pipeline.py]"]
end

node_user(("User"))

node_user -.->|"runs"| node_workflow
node_workflow -->|"reads"| node_csv
node_workflow -->|"separates"| node_features
node_features -->|"configures"| node_preprocessing
node_features -->|"splits"| node_training
node_training -->|"predicts and scores"| node_evaluation
node_training -->|"saves"| node_artifact
node_evaluation -->|"visualizes"| node_plots

click node_csv "https://github.com/joshwen7947/machine-learning-pipeline/blob/main/ML_pipeline/vehicle_emissions.csv"
click node_workflow "https://github.com/joshwen7947/machine-learning-pipeline/blob/main/ML_pipeline/pipeline.py"
click node_features "https://github.com/joshwen7947/machine-learning-pipeline/blob/main/ML_pipeline/pipeline.py"
click node_preprocessing "https://github.com/joshwen7947/machine-learning-pipeline/blob/main/ML_pipeline/pipeline.py"
click node_training "https://github.com/joshwen7947/machine-learning-pipeline/blob/main/ML_pipeline/pipeline.py"
click node_evaluation "https://github.com/joshwen7947/machine-learning-pipeline/blob/main/ML_pipeline/pipeline.py"
click node_artifact "https://github.com/joshwen7947/machine-learning-pipeline/blob/main/ML_pipeline/pipeline.py"
click node_plots "https://github.com/joshwen7947/machine-learning-pipeline/blob/main/ML_pipeline/pipeline.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_csv,node_user toneBlue
class node_workflow,node_features,node_preprocessing,node_training toneAmber
class node_evaluation,node_artifact,node_plots toneMint
```

## Components

### Input data

- [Emissions CSV](https://github.com/joshwen7947/machine-learning-pipeline/blob/main/ML_pipeline/vehicle_emissions.csv): `ML_pipeline/vehicle_emissions.csv`

### Model workflow

- [Pipeline script](https://github.com/joshwen7947/machine-learning-pipeline/blob/main/ML_pipeline/pipeline.py): `ML_pipeline/pipeline.py`
- [Feature preparation](https://github.com/joshwen7947/machine-learning-pipeline/blob/main/ML_pipeline/pipeline.py): `ML_pipeline/pipeline.py`
- [Preprocessing](https://github.com/joshwen7947/machine-learning-pipeline/blob/main/ML_pipeline/pipeline.py): `ML_pipeline/pipeline.py`
- [Model training](https://github.com/joshwen7947/machine-learning-pipeline/blob/main/ML_pipeline/pipeline.py): `ML_pipeline/pipeline.py`

### Results

- [Evaluation metrics](https://github.com/joshwen7947/machine-learning-pipeline/blob/main/ML_pipeline/pipeline.py): `ML_pipeline/pipeline.py`
- [Saved pipeline](https://github.com/joshwen7947/machine-learning-pipeline/blob/main/ML_pipeline/pipeline.py): `ML_pipeline/pipeline.py`
- [Evaluation plots](https://github.com/joshwen7947/machine-learning-pipeline/blob/main/ML_pipeline/pipeline.py): `ML_pipeline/pipeline.py`

### Other components

- **User**

## Connections

- User → Pipeline script: runs
- Pipeline script → Emissions CSV: reads (evidence: `ML_pipeline/pipeline.py`)
- Pipeline script → Feature preparation: separates (evidence: `ML_pipeline/pipeline.py`)
- Feature preparation → Preprocessing: configures (evidence: `ML_pipeline/pipeline.py`)
- Feature preparation → Model training: splits (evidence: `ML_pipeline/pipeline.py`)
- Model training → Evaluation metrics: predicts and scores (evidence: `ML_pipeline/pipeline.py`)
- Model training → Saved pipeline: saves (evidence: `ML_pipeline/pipeline.py`)
- Evaluation metrics → Evaluation plots: visualizes (evidence: `ML_pipeline/pipeline.py`)
