How eakeweje/gpmix works
Project type and purpose
• This is a Python-based open-source library and CLI tool for clustering functional data via mixtures of Gaussian processes.
• Core focus: load raw data, smooth into continuous curves, project onto random bases, learn univariate GMMs on each projection, then extract an ensemble consensus clustering.
• It also ships simulation scripts and YAML configuration for reproducing experiments.
File structure
• Top-level directories/files:
• CBF/ ← example dataset (CBF_TRAIN.txt, CBF_TEST.txt)
• data_configs/ ← YAML files for simulation scenarios A–L
• GPmix/ ← core Python package
– __init__.py
– smoother.py
– projector.py
– unigmm.py
– misc.py
• GPmix_Clustering.py ← CLI entry point that reads a config and runs a pipeline
• simulations.py ← orchestration script for all scenarios
• requirements.txt, LICENSE, README.md
Extract architectural insights from README
• Four sequential pipeline steps:
1. Smoothing (GPmix.Smoother)
2. Projection (GPmix.Projector)
3. GMM learning & ensemble (GPmix.UniGaussianMixtureEnsemble)
4. Consensus clustering & validation (misc.estimate_nclusters + plot/score methods)
• CLI uses data_configs/*.yml to parameterize scenario runs.
• Depends on NumPy, scikit-fda, pywt, scikit-learn, joblib, seaborn, PyYAML.
Main components
A. Data Ingestion & Configuration
• Raw data files (TXT, CSV)
• YAML config loader (PyYAML)
• CLI scripts (GPmix_Clustering.py, simulations.py)
B. Core Library Modules (GPmix package)
• Smoother: inputs raw array → outputs FDataGrid
• Projector: inputs FDataGrid → outputs projection coefficients
• UniGaussianMixtureEnsemble: inputs coefficients → outputs cluster labels
• misc.estimate_nclusters: inputs FDataGrid → outputs optimal k
C. External Dependencies
• Numeric & scientific libs (NumPy, SciPy, scikit-learn, scikit-fda, pywt, joblib)
D. Visualization & Validation
• Plot methods in Smoother, Projector, UniGaussianMixtureEnsemble
• Scoring methods: AMI, ARI, silhouette, Davis–Bouldin
E. Output Artifacts
• Clustered functional plots (PNG)
• Experiment logs & metrics
• Saved models or intermediate data (optional)
Relationships and data flow
1. CLI Script ← reads YAML config & selects dataset (CBF/ or simulation generator)
2. Smoother.fit ← raw data → FDataGrid
3. Projector.fit ← FDataGrid → projection coefficients (array)
4. UniGaussianMixtureEnsemble.fit_gmms ← coefficients → list of GMMs
5. get_clustering ← GMMs → final cluster labels
6. plot_clustering, plot_gmms, plot_projection_coeffs ← visual outputs
7. misc.estimate_nclusters can be invoked at step 4 to search k
Architectural patterns & design principles
• Modular pipeline: each step encapsulated in a class with fit/transform APIs
• “Estimator” pattern similar to scikit-learn (fit, transform, plot)
• Functional separation: data ingestion, processing, learning, ensemble, evaluation
• Config-driven experiments for reproducibility (YAML + CLI)
• Parallelization of GMM fitting via joblib
• [ ] All components drawn and labeled
• [ ] Data formats annotated on edges
• [ ] Clear separation between “Core Library” and “Orchestration Layer”
• [ ] Visual grouping of config files and datasets
• [ ] Notes on parallel GMM fitting and validation metrics