# sushantkumar31/feature-engineering-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/sushantkumar31/feature-engineering-analyzer
- Repository: https://github.com/sushantkumar31/feature-engineering-analyzer

## Overview

#### Purpose and Entry Point
This is a single-process Streamlit application for demonstrating the effect of tabular-data feature engineering on ML performance. The executable UI and pipeline implementation are centralized in `app.py`; users launch it with `streamlit run app.py`.

#### Interactive Dataset Intake
The app accepts a user-uploaded CSV, presents dataset preview/statistics, and requires selection/validation of a target column. Uploaded data is in-memory and session-driven rather than backed by a database or persistent dataset service.
- `app.py`

#### Baseline Data Path
The original uploaded dataset forms the baseline branch. The selected target is separated from predictors, and the chosen ML algorithm is trained/evaluated on raw-data preparation appropriate for model input. Its metrics establish the comparison reference.
- `app.py`

#### Engineering and Preprocessing Path
A separate engineered-data branch applies user-selected transformations: missing-value treatment, outlier handling, numerical scaling, categorical encoding, correlation analysis, and feature selection. This produces the processed feature matrix used for the second training run.
- `app.py`

#### Controlled Model Comparison
The architecture’s central invariant is use of the same selected learning algorithm for both raw and engineered datasets. The application trains baseline and engineered models, calculates evaluation metrics, and renders their side-by-side performance comparison so changes are attributable to preprocessing/feature engineering.
- `app.py`

#### Visualization and Artifact Export
Streamlit renders interactive tables, metrics, and visual analysis such as correlation heatmaps. Users can download the engineered dataset and serialized trained model; model persistence uses Joblib rather than an external model registry or storage service.
- `app.py`
- `assets/demo.gif`
- `assets/results.png`

#### Runtime and Dependencies
The runtime is Python, pinned operationally by `.python-version` and `runtime.txt`, with Streamlit serving the UI. Core processing uses pandas/NumPy; scikit-learn supplies preprocessing, selection, models, and evaluation; Matplotlib/Seaborn provide plots; Joblib serializes artifacts. Dependency installation is defined by `requirements.txt`. The included dev container supports reproducible development but is not an application service boundary.
- `requirements.txt`
- `runtime.txt`
- `.python-version`
- `.devcontainer/devcontainer.json`

Main entry points: [`app.py`](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py) (Feature engineering), [`requirements.txt`](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/requirements.txt) (Python dependencies), [`runtime.txt`](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/runtime.txt) (Python runtime), [`.python-version`](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/.python-version) (Local Python version)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Streamlit UI"]
  node_streamlit_app["Streamlit app<br/>Python application<br/>[app.py]"]
  node_csv_upload["CSV upload<br/>in-memory dataset<br/>[app.py]"]
  node_target_selection["Target validation<br/>UI workflow<br/>[app.py]"]
end

subgraph group_pipeline["Comparison Pipeline"]
  node_baseline_prep["Raw-data preparation<br/>baseline branch<br/>[app.py]"]
  node_feature_engineering["Feature engineering<br/>processing branch<br/>[app.py]"]
  node_baseline_model["Baseline model<br/>scikit-learn model<br/>[app.py]"]
  node_engineered_model["Engineered model<br/>scikit-learn model<br/>[app.py]"]
  node_evaluation["Metrics comparison<br/>evaluation<br/>[app.py]"]
end

subgraph group_output["Outputs"]
  node_visualizations["Tables and plots<br/>Streamlit visualization<br/>[app.py]"]
  node_dataset_export["Engineered dataset download<br/>export artifact<br/>[app.py]"]
  node_model_export["Serialized model download<br/>Joblib artifact<br/>[app.py]"]
end

subgraph group_runtime["Runtime"]
  node_dependencies["Python dependencies<br/>requirements<br/>[requirements.txt]"]
  node_python_runtime["Python runtime<br/>runtime pin<br/>[runtime.txt]"]
  node_python_version["Local Python version<br/>version pin<br/>[.python-version]"]
  node_dev_container["Development container<br/>development environment<br/>[devcontainer.json]"]
end

node_user(("User<br/>actor"))

node_user -->|"runs and interacts"| node_streamlit_app
node_streamlit_app -->|"accepts"| node_csv_upload
node_csv_upload -->|"previewed and profiled"| node_target_selection
node_target_selection -->|"splits target and predictors"| node_baseline_prep
node_target_selection -->|"configures transformations"| node_feature_engineering
node_baseline_prep -->|"raw features"| node_baseline_model
node_feature_engineering -->|"processed matrix"| node_engineered_model
node_baseline_model -->|"baseline metrics"| node_evaluation
node_engineered_model -->|"engineered metrics"| node_evaluation
node_baseline_model -.->|"same selected algorithm"| node_engineered_model
node_evaluation -->|"side-by-side results"| node_visualizations
node_feature_engineering -->|"correlation analysis"| node_visualizations
node_feature_engineering -->|"exports processed data"| node_dataset_export
node_engineered_model -->|"serializes with Joblib"| node_model_export
node_dependencies -.->|"provides libraries"| node_streamlit_app
node_python_runtime -.->|"runs"| node_streamlit_app
node_python_version -.->|"local pin"| node_python_runtime
node_dev_container -.->|"reproducible development"| node_dependencies

click node_streamlit_app "https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py"
click node_csv_upload "https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py"
click node_target_selection "https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py"
click node_baseline_prep "https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py"
click node_feature_engineering "https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py"
click node_baseline_model "https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py"
click node_engineered_model "https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py"
click node_evaluation "https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py"
click node_visualizations "https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py"
click node_dataset_export "https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py"
click node_model_export "https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py"
click node_dependencies "https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/requirements.txt"
click node_python_runtime "https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/runtime.txt"
click node_python_version "https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/.python-version"
click node_dev_container "https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/.devcontainer/devcontainer.json"

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_streamlit_app,node_csv_upload,node_target_selection toneBlue
class node_baseline_prep,node_feature_engineering,node_baseline_model,node_engineered_model,node_evaluation toneAmber
class node_visualizations,node_dataset_export,node_model_export toneMint
class node_dependencies,node_python_runtime,node_python_version,node_dev_container toneRose
class node_user toneNeutral
```

## Components

### Streamlit UI

- [Streamlit app](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py): Python application · Single-process interactive entry point. · `app.py`
- [CSV upload](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py): in-memory dataset · Session-driven uploaded tabular data. · `app.py`
- [Target validation](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py): UI workflow · `app.py`

### Comparison Pipeline

Both branches use the same selected algorithm.

- [Raw-data preparation](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py): baseline branch · `app.py`
- [Feature engineering](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py): processing branch · Applies missing-value, outlier, scaling, encoding, correlation, and selection options. · `app.py`
- [Baseline model](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py): scikit-learn model · `app.py`
- [Engineered model](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py): scikit-learn model · `app.py`
- [Metrics comparison](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py): evaluation · Calculates and compares baseline and engineered performance. · `app.py`

### Outputs

- [Tables and plots](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py): Streamlit visualization · Includes correlation heatmaps and interactive analysis. · `app.py`
- [Engineered dataset download](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py): export artifact · `app.py`
- [Serialized model download](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/app.py): Joblib artifact · `app.py`

### Runtime

- [Python dependencies](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/requirements.txt): requirements · Streamlit, pandas, NumPy, scikit-learn, Matplotlib, Seaborn, and Joblib. · `requirements.txt`
- [Python runtime](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/runtime.txt): runtime pin · `runtime.txt`
- [Local Python version](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/.python-version): version pin · `.python-version`
- [Development container](https://github.com/sushantkumar31/feature-engineering-analyzer/blob/main/.devcontainer/devcontainer.json): development environment · Reproducible development support, not an application service. · `.devcontainer/devcontainer.json`

### Other components

- **User**: actor

## Connections

- User → Streamlit app: runs and interacts
- Streamlit app → CSV upload: accepts
- CSV upload → Target validation: previewed and profiled
- Target validation → Raw-data preparation: splits target and predictors
- Target validation → Feature engineering: configures transformations
- Raw-data preparation → Baseline model: raw features
- Feature engineering → Engineered model: processed matrix
- Baseline model → Metrics comparison: baseline metrics
- Engineered model → Metrics comparison: engineered metrics
- Baseline model → Engineered model: same selected algorithm
- Metrics comparison → Tables and plots: side-by-side results
- Feature engineering → Tables and plots: correlation analysis
- Feature engineering → Engineered dataset download: exports processed data
- Engineered model → Serialized model download: serializes with Joblib
- Python dependencies → Streamlit app: provides libraries
- Python runtime → Streamlit app: runs
- Local Python version → Python runtime: local pin
- Development container → Python dependencies: reproducible development
