An interactive web application for exploratory factor analysis with varimax rotation, auto-labeled factors, and rich visualizations.
Factor Analysis Tool is a Streamlit-based web application that allows users to upload datasets (CSV or Excel), select variables, and perform factor analysis with varimax rotation. The tool automatically labels factors based on their highest-loading variables, making results easy to interpret even for non-statisticians.
- File Upload — Supports CSV and Excel (.xlsx/.xls) files, plus a built-in demo dataset
- Interactive Variable Selection — Checkbox-based UI with human-readable column names
- Varimax Rotation — Orthogonal rotation for clearer, more interpretable factor loadings
- Auto-Labeled Factors — Factors are automatically named by their top two loading variables
- Comprehensive Output — Variance explained, communalities, correlation matrix, and factor scores
- Visual Analytics — Tabbed visualizations: correlation matrix heatmap, factor loadings bar chart, scree plot, and factor scores scatter plot
- Dark Theme — Polished dark UI with teal accents and custom-styled charts
| Category | Technology |
|---|---|
| Frontend | Streamlit |
| Backend | Python 3.13 |
| Analytics | scikit-learn, NumPy, Pandas, SciPy |
| Visualization | Matplotlib |
| Package Manager | uv |
┌─────────────────────────────────────────────┐
│ Streamlit UI │
│ ┌──────────┐ ┌────────────┐ ┌─────────┐ │
│ │ Sidebar │ │ Checkbox │ │ Charts │ │
│ │ Upload / │ │ Factor │ │ Bar + │ │
│ │ Theme │ │ Selector │ │ Scatter │ │
│ └──────────┘ └────────────┘ └─────────┘ │
├─────────────────────────────────────────────┤
│ Analysis Engine │
│ StandardScaler → FactorAnalysis → Varimax │
│ → Loadings, Scores, Variance, Communality │
├─────────────────────────────────────────────┤
│ Data Layer │
│ CSV / Excel Upload │ Demo Dataset │
└─────────────────────────────────────────────┘
factoranalysis/
├── app.py # Main Streamlit application
├── factoranalysis.py # Reference factor analysis script
├── creditcarddata.csv # Demo dataset
├── pyproject.toml # Project configuration & dependencies
├── uv.lock # Locked dependency versions
├── .python-version # Python version (3.13)
└── .gitignore
- Python 3.13+
- uv package manager
# Clone the repository
git clone https://github.com/alfredang/factoranalysi.git
cd factoranalysi
# Install dependencies
uv syncuv run streamlit run app.pyThe app will open at http://localhost:8501.
- Choose a data source — Upload your own CSV/Excel file or use the built-in demo dataset
- Select factors — Check the variables you want to include in the analysis
- Configure — Adjust the number of factors to extract
- Run — Click "Run Factor Analysis" to see results
- Interpret — Review factor loadings, variance explained, communalities, and visualizations
Contributions are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Commit your changes (
git commit -m 'Add my feature') - Push to the branch (
git push origin feature/my-feature) - Open a Pull Request
Powered by Tertiary Academy Pte Ltd
If you found this project useful, please consider giving it a star!
