How benkraoudaamine0/pca_from_scratch works
This is a browser-based PCA analysis application. Users upload a CSV, choose normalization and a component-selection method, and receive PCA results to explore through plots and matrix views; the backend also exposes an AI interpretation endpoint. The graph follows the documented workflow and the sampled API, PCA, schema, and frontend code. Some rendering and interpretation wiring is only partially excerpted, so those relationships are omitted where the available evidence does not establish them.
Main entry points: main.py Analysis endpoints · script.js Upload and dashboard · index.html Analysis interface · models.py Response schemas
Components 11
Browser interface
- Analysis interface
frontend/index.html - Upload and dashboard
frontend/script.js - Scree plots
frontend/script.js - Factor visualizations
frontend/script.js - Matrices and metrics
frontend/script.js
Analysis API
- Analysis endpoints
backend/main.py - Data preparation
backend/main.py - Response schemas
backend/shema/models.py
PCA computation
- PCA engine
backend/core/logic.py
Interpretation integration
- Gemini service
Other components
- Analyst
Connections 11
- Analyst → Analysis interface: uses
README.md - Analysis interface → Upload and dashboard: hosts
README.md - Upload and dashboard → Analysis endpoints: posts analysis
frontend/script.js - Analysis endpoints → Data preparation: reads upload
backend/main.py - Analysis endpoints → PCA engine: runs PCA
backend/main.py - Analysis endpoints → Response schemas: validates response
backend/main.py - Analysis endpoints → Upload and dashboard: returns results
frontend/script.js - Upload and dashboard → Scree plots: renders plots
README.md - Upload and dashboard → Factor visualizations: renders views
frontend/script.js - Upload and dashboard → Matrices and metrics: renders tables
frontend/script.js - Analysis endpoints → Gemini service: requests interpretation
backend/main.py