A small Python toolkit for loading, cleaning, analyzing, clustering, and visualizing experimental datasets.
- Load Excel (.xlsx) files into a lightweight Dataset API
- Immutable DataInstance/Dataset abstractions with schema integrity handling
- Cleaning utilities to normalize values/keys (e.g., unify NaNs, fix typos)
- Plotting helpers:
- Correlation scatter with stats and best-fit line
- Category comparison (box + strip) with stats annotation
- Clustering grid search across preprocessing, dimensionality reduction (t-SNE/UMAP), and clustering methods (KMeans, Spectral, GMM)
- Saves figures to plots/ and a grid-search summary Excel
- Python 3.11+
- numpy, pandas
- matplotlib, seaborn
- scipy
- scikit-learn
- umap-learn
- openpyxl (for reading .xlsx via pandas)
.
├─ analysis_demo.py # Example workflow: load → clean → analyze → plot → cluster
├─ data/ # Local data (Excel files). Consider ignoring in Git
│ └─ DataFromJoe/ # Example source datasets (.xlsx)
├─ plots/ # Auto-generated figures and summaries
└─ src/
├─ analysis/
│ └─ clustering.py # Preprocess, reduce dimensions, and cluster (+ grid search)
├─ plotter/
│ ├─ basic_plotting.py # Correlation/comparison plots with stats overlays
│ ├─ clustering_plotting.py
│ └─ stats_plotting.py
├─ data_loader.py # Excel loader → Dataset
├─ data_cleaner.py # Cleaning rules (e.g., joe_data_cleaner)
└─ data_core.py # DataInstance/Dataset abstractions
python analysis_demo.py
This will:
- Load multiple Excel files into a single Dataset
- Apply cleaning rules (joe_data_cleaner)
- Produce correlation and comparison plots
- Run a clustering grid search (preprocessing × dimension reduction × clustering)
- Save figures under plots/ and a grid-search summary Excel at plots/clustering/grid_search_summary.xlsx