# willsephton/nasdaqprediction-2025 architecture

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

- Interactive diagram: https://gitdiagram.com/willsephton/nasdaqprediction-2025
- Repository: https://github.com/willsephton/nasdaqprediction-2025

## Overview

This is a Streamlit dashboard for exploring NASDAQ-100 stock data through clustering, correlation, exploratory visualizations, and four forecasting approaches. The main workflow begins with ticker loading and user selection in `main.py`; the selected view then obtains the relevant market data and invokes its analysis module to display results. Forecasting includes a Prophet-derived buy/sell signal, while linear regression also reads and writes a local pickle model. The README documents the app’s purpose and launch method; the graph’s module wiring is based on the sampled source.

Main entry points: [`main.py`](https://github.com/willsephton/nasdaqprediction-2025/blob/master/main.py) (Streamlit dashboard), [`modules/dataRetrival.py`](https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/dataRetrival.py) (Ticker discovery), [`modules/pcaAndKMeans.py`](https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/pcaAndKMeans.py) (PCA reduction), [`modules/prophetPrediction.py`](https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/prophetPrediction.py) (Prophet forecast)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_app["Streamlit dashboard<br/>[main.py]"]
end

subgraph group_market_data["Market Data"]
  node_ticker_list["Ticker discovery<br/>[dataRetrival.py]"]
  node_market_fetch["Market data retrieval<br/>[dataRetrival.py]"]
  node_cluster_prep["Clustering data<br/>[dataRetrival.py]"]
  node_correlation_data["Correlation and EDA data<br/>[dataRetrival.py]"]
  node_forecast_data["Forecast data<br/>[dataRetrival.py]"]
end

subgraph group_analysis["Analysis"]
  node_pca["PCA reduction<br/>[pcaAndKMeans.py]"]
  node_kmeans["KMeans clustering<br/>[pcaAndKMeans.py]"]
  node_correlations["Correlation analysis<br/>[correlation.py]"]
  node_eda["Exploratory charts<br/>[eda.py]"]
end

subgraph group_forecasting["Forecasting"]
  node_prophet["Prophet forecast"]
  node_signals["Buy-sell signals<br/>[buySellSignals.py]"]
  node_arima["ARIMA forecast<br/>[arima.py]"]
  node_lstm["LSTM forecast<br/>[lstm.py]"]
  node_linear_regression["Linear regression"]
  node_model_file["Pickled model file"]
end

node_user(("Dashboard user"))
node_wiki["NASDAQ constituents"]
node_yahoo["Yahoo Finance"]

node_user -->|"selects view"| node_app
node_app -->|"loads tickers"| node_ticker_list
node_ticker_list -->|"requests constituents"| node_wiki
node_app -->|"requests clustering data"| node_cluster_prep
node_app -->|"requests analysis data"| node_correlation_data
node_app -->|"requests forecast data"| node_forecast_data
node_cluster_prep -->|"downloads prices"| node_yahoo
node_correlation_data -->|"downloads prices"| node_yahoo
node_forecast_data -->|"downloads prices"| node_yahoo
node_app -->|"runs PCA"| node_pca
node_pca -->|"returns reduced data"| node_kmeans
node_app -->|"runs clustering"| node_kmeans
node_app -->|"runs correlations"| node_correlations
node_app -->|"renders EDA"| node_eda
node_app -->|"runs forecast"| node_prophet
node_prophet -->|"passes forecast"| node_signals
node_app -->|"runs forecast"| node_arima
node_app -->|"runs forecast"| node_lstm
node_app -->|"runs forecast"| node_linear_regression
node_linear_regression -->|"loads and saves"| node_model_file

click node_app "https://github.com/willsephton/nasdaqprediction-2025/blob/master/main.py"
click node_ticker_list "https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/dataRetrival.py"
click node_market_fetch "https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/dataRetrival.py"
click node_cluster_prep "https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/dataRetrival.py"
click node_correlation_data "https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/dataRetrival.py"
click node_forecast_data "https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/dataRetrival.py"
click node_pca "https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/pcaAndKMeans.py"
click node_kmeans "https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/pcaAndKMeans.py"
click node_correlations "https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/correlation.py"
click node_eda "https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/eda.py"
click node_prophet "https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/prophetPrediction.py"
click node_signals "https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/buySellSignals.py"
click node_arima "https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/arima.py"
click node_lstm "https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/lstm.py"
click node_linear_regression "https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/linearRegression.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_user toneBlue
class node_ticker_list,node_market_fetch,node_cluster_prep,node_correlation_data,node_forecast_data toneAmber
class node_pca,node_kmeans,node_correlations,node_eda toneMint
class node_prophet,node_signals,node_arima,node_lstm,node_linear_regression,node_model_file toneRose
class node_wiki,node_yahoo toneIndigo
```

## Components

### Dashboard

- [Streamlit dashboard](https://github.com/willsephton/nasdaqprediction-2025/blob/master/main.py): `main.py`

### Market Data

- [Ticker discovery](https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/dataRetrival.py): `modules/dataRetrival.py`
- [Market data retrieval](https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/dataRetrival.py): `modules/dataRetrival.py`
- [Clustering data](https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/dataRetrival.py): `modules/dataRetrival.py`
- [Correlation and EDA data](https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/dataRetrival.py): `modules/dataRetrival.py`
- [Forecast data](https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/dataRetrival.py): `modules/dataRetrival.py`

### Analysis

- [PCA reduction](https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/pcaAndKMeans.py): `modules/pcaAndKMeans.py`
- [KMeans clustering](https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/pcaAndKMeans.py): `modules/pcaAndKMeans.py`
- [Correlation analysis](https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/correlation.py): `modules/correlation.py`
- [Exploratory charts](https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/eda.py): `modules/eda.py`

### Forecasting

- [Prophet forecast](https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/prophetPrediction.py): `modules/prophetPrediction.py`
- [Buy-sell signals](https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/buySellSignals.py): `modules/buySellSignals.py`
- [ARIMA forecast](https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/arima.py): `modules/arima.py`
- [LSTM forecast](https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/lstm.py): `modules/lstm.py`
- [Linear regression](https://github.com/willsephton/nasdaqprediction-2025/blob/master/modules/linearRegression.py): `modules/linearRegression.py`
- **Pickled model file**

### Other components

- **Dashboard user**
- **NASDAQ constituents**
- **Yahoo Finance**

## Connections

- Dashboard user → Streamlit dashboard: selects view
- Streamlit dashboard → Ticker discovery: loads tickers
- Ticker discovery → NASDAQ constituents: requests constituents
- Streamlit dashboard → Clustering data: requests clustering data
- Streamlit dashboard → Correlation and EDA data: requests analysis data
- Streamlit dashboard → Forecast data: requests forecast data
- Clustering data → Yahoo Finance: downloads prices
- Correlation and EDA data → Yahoo Finance: downloads prices
- Forecast data → Yahoo Finance: downloads prices
- Streamlit dashboard → PCA reduction: runs PCA
- PCA reduction → KMeans clustering: returns reduced data
- Streamlit dashboard → KMeans clustering: runs clustering
- Streamlit dashboard → Correlation analysis: runs correlations
- Streamlit dashboard → Exploratory charts: renders EDA
- Streamlit dashboard → Prophet forecast: runs forecast
- Prophet forecast → Buy-sell signals: passes forecast
- Streamlit dashboard → ARIMA forecast: runs forecast
- Streamlit dashboard → LSTM forecast: runs forecast
- Streamlit dashboard → Linear regression: runs forecast
- Linear regression → Pickled model file: loads and saves
