YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
license: mit title: PCA Finance Dashboard emoji: ๐ colorFrom: blue colorTo: indigo sdk: streamlit sdk_version: "1.32.0" app_file: pca.py pinned: false tags:
PCA Finance Dashboard
Author: ssjs
Overview
This project is an interactive Streamlit dashboard for exploring Principal Component Analysis (PCA) on financial return series.
You can either generate synthetic returns or upload your own CSV of asset returns and inspect:
- Scree plot and variance explained
- PCA biplot (scores and loadings)
- Loading heatmap
- Top contributors to the first principal component
- Equal-weight portfolio factor exposure
Requirements
- Python 3.9+ (3.10 or 3.11 recommended)
- The following Python packages:
streamlitpandasnumpyscikit-learnplotly
You can install them with:
pip install streamlit pandas numpy scikit-learn plotly
How to Run the Dashboard
Open a terminal (PowerShell, Command Prompt, or any shell).
Change directory into the folder that contains
pca.py:cd "C:\Users\sharm\Downloads\New folder"Run the Streamlit app:
streamlit run pca.pyAfter a few seconds Streamlit will print a local URL, for example:
Local URL: http://localhost:8501Open that URL in your browser to use the dashboard.
Notes
If the default port (8501) is already in use, you can choose another one, e.g.:
streamlit run pca.py --server.port 8505For reproducible synthetic data, you can adjust the random seed in the sidebar.