# rohannx29/stock-price-prediction-webapp architecture

> Architecture diagram of the GitHub repository rohannx29/stock-price-prediction-webapp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rohannx29/stock-price-prediction-webapp
- Repository: https://github.com/rohannx29/stock-price-prediction-webapp

## Overview

This is a Streamlit stock-price and trend prediction dashboard. The principal workflow runs from user-selected ticker and trading settings through Yahoo Finance data acquisition, technical-feature engineering, model training, and an in-range prediction or future forecast; results include charts, evaluation metrics, and downloadable CSVs. Historical queries use as-of retraining, while optional studies compare validation and modeling choices. The graph follows README-described orchestration and shown module calls; some app internals and lookup behavior were not excerpted, so their details are represented only where documented.

Main entry points: [`app.py`](https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/app.py) (Dashboard orchestration), [`src/models.py`](https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/models.py) (Regression and classification), [`src/forecasting.py`](https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/forecasting.py) (Recursive forecasts), [`src/evaluation.py`](https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/evaluation.py) (Metrics and baselines)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Dashboard"]
  node_app["Dashboard orchestration<br/>[app.py]"]
  node_results["Charts and downloads<br/>[app.py]"]
end

subgraph group_market["Market data"]
  node_loader["OHLCV acquisition<br/>[data_loader.py]"]
  node_features["Technical features<br/>[indicators.py]"]
  node_calendar["NYSE calendar<br/>[calendar_utils.py]"]
end

subgraph group_prediction["Prediction"]
  node_models["Regression and classification<br/>[models.py]"]
  node_forecast["Recursive forecasts<br/>[forecasting.py]"]
  node_walkforward["As-of retraining<br/>[walk_forward.py]"]
  node_lookup["Nearest-row lookup<br/>[lookup.py]"]
end

subgraph group_analysis["Evaluation and studies"]
  node_evaluation["Metrics and baselines<br/>[evaluation.py]"]
  node_cv["Time-series validation"]
  node_ablation["Feature ablation"]
  node_target["Target comparison"]
  node_horizon["Horizon comparison<br/>[horizon_study.py]"]
end

node_user(("Trader"))
node_yahoo["Yahoo Finance"]

node_user -->|"selects and runs"| node_app
node_app -->|"requests market data"| node_loader
node_loader -->|"downloads OHLCV"| node_yahoo
node_app -->|"builds features"| node_features
node_app -->|"trains and predicts"| node_models
node_app -->|"requests future forecast"| node_forecast
node_forecast -->|"recomputes features"| node_features
node_forecast -->|"predicts next step"| node_models
node_forecast -->|"advances trading day"| node_calendar
node_app -->|"retrains for history"| node_walkforward
node_walkforward -->|"trains as-of models"| node_models
node_app -->|"locates requested row"| node_lookup
node_app -->|"reports metrics"| node_evaluation
node_app -->|"runs optional validation"| node_cv
node_cv -->|"trains and predicts"| node_models
node_cv -->|"scores folds"| node_evaluation
node_app -->|"runs optional study"| node_ablation
node_ablation -->|"trains feature variants"| node_models
node_ablation -->|"scores variants"| node_evaluation
node_app -->|"runs optional comparison"| node_target
node_target -->|"trains target variants"| node_models
node_target -->|"scores targets"| node_evaluation
node_app -->|"runs optional comparison"| node_horizon
node_horizon -->|"evaluates recursive strategy"| node_forecast
node_horizon -->|"trains direct models"| node_models
node_horizon -->|"scores horizons"| node_evaluation
node_app -->|"renders and exports"| node_results

click node_app "https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/app.py"
click node_results "https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/app.py"
click node_loader "https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/data_loader.py"
click node_features "https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/indicators.py"
click node_calendar "https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/calendar_utils.py"
click node_models "https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/models.py"
click node_forecast "https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/forecasting.py"
click node_walkforward "https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/walk_forward.py"
click node_lookup "https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/lookup.py"
click node_evaluation "https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/evaluation.py"
click node_cv "https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/cross_validation.py"
click node_ablation "https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/feature_ablation.py"
click node_target "https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/target_experiment.py"
click node_horizon "https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/horizon_study.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_app,node_results toneBlue
class node_loader,node_features,node_calendar toneAmber
class node_models,node_forecast,node_walkforward,node_lookup toneMint
class node_evaluation,node_cv,node_ablation,node_target,node_horizon toneRose
class node_user,node_yahoo toneIndigo
```

## Components

### Dashboard

- [Dashboard orchestration](https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/app.py): `app.py`
- [Charts and downloads](https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/app.py): `app.py`

### Market data

- [OHLCV acquisition](https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/data_loader.py): `src/data_loader.py`
- [Technical features](https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/indicators.py): `src/indicators.py`
- [NYSE calendar](https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/calendar_utils.py): `src/calendar_utils.py`

### Prediction

- [Regression and classification](https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/models.py): `src/models.py`
- [Recursive forecasts](https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/forecasting.py): `src/forecasting.py`
- [As-of retraining](https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/walk_forward.py): `src/walk_forward.py`
- [Nearest-row lookup](https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/lookup.py): `src/lookup.py`

### Evaluation and studies

- [Metrics and baselines](https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/evaluation.py): `src/evaluation.py`
- [Time-series validation](https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/cross_validation.py): `src/cross_validation.py`
- [Feature ablation](https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/feature_ablation.py): `src/feature_ablation.py`
- [Target comparison](https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/target_experiment.py): `src/target_experiment.py`
- [Horizon comparison](https://github.com/rohannx29/stock-price-prediction-webapp/blob/main/src/horizon_study.py): `src/horizon_study.py`

### Other components

- **Trader**
- **Yahoo Finance**

## Connections

- Trader → Dashboard orchestration: selects and runs (evidence: `README.md`)
- Dashboard orchestration → OHLCV acquisition: requests market data (evidence: `README.md`)
- OHLCV acquisition → Yahoo Finance: downloads OHLCV (evidence: `src/data_loader.py`)
- Dashboard orchestration → Technical features: builds features (evidence: `README.md`)
- Dashboard orchestration → Regression and classification: trains and predicts (evidence: `README.md`)
- Dashboard orchestration → Recursive forecasts: requests future forecast (evidence: `README.md`)
- Recursive forecasts → Technical features: recomputes features (evidence: `src/forecasting.py`)
- Recursive forecasts → Regression and classification: predicts next step (evidence: `src/forecasting.py`)
- Recursive forecasts → NYSE calendar: advances trading day (evidence: `src/forecasting.py`)
- Dashboard orchestration → As-of retraining: retrains for history (evidence: `README.md`)
- As-of retraining → Regression and classification: trains as-of models (evidence: `src/walk_forward.py`)
- Dashboard orchestration → Nearest-row lookup: locates requested row (evidence: `README.md`)
- Dashboard orchestration → Metrics and baselines: reports metrics (evidence: `README.md`)
- Dashboard orchestration → Time-series validation: runs optional validation (evidence: `app.py`)
- Time-series validation → Regression and classification: trains and predicts (evidence: `src/cross_validation.py`)
- Time-series validation → Metrics and baselines: scores folds (evidence: `src/cross_validation.py`)
- Dashboard orchestration → Feature ablation: runs optional study (evidence: `app.py`)
- Feature ablation → Regression and classification: trains feature variants (evidence: `src/feature_ablation.py`)
- Feature ablation → Metrics and baselines: scores variants (evidence: `src/feature_ablation.py`)
- Dashboard orchestration → Target comparison: runs optional comparison (evidence: `app.py`)
- Target comparison → Regression and classification: trains target variants (evidence: `src/target_experiment.py`)
- Target comparison → Metrics and baselines: scores targets (evidence: `src/target_experiment.py`)
- Dashboard orchestration → Horizon comparison: runs optional comparison (evidence: `app.py`)
- Horizon comparison → Recursive forecasts: evaluates recursive strategy (evidence: `src/horizon_study.py`)
- Horizon comparison → Regression and classification: trains direct models (evidence: `src/horizon_study.py`)
- Horizon comparison → Metrics and baselines: scores horizons (evidence: `src/horizon_study.py`)
- Dashboard orchestration → Charts and downloads: renders and exports (evidence: `README.md`)
