Expand description
§flow-pacmap
First-party implementation of PaCMAP (Pairwise Controlled Manifold Approximation Projection) from Wang et al. 2021 (JMLR 22, Algorithm 1).
Designed for large-n flow cytometry data:
- No ndarray version conflicts — pure
&[f32]/Vec<[f32;2]>API - PCA via faer SVD on the d×d covariance matrix (O(n·d²), no large intermediates)
- HNSW KNN via usearch (C++ FFI, hardware SIMD, optional f16 quantization)
- All pair counts use
checked_mul; no debug-mode overflow panics - Progress reporting via
mpsc::Sender<PaCMAPProgress>(per phase + every 10 iters) - Cancellation via
Arc<AtomicBool>
Re-exports§
pub use config::DistanceMetric;pub use config::HnswParams;pub use config::Init;pub use config::KnnMethod;pub use config::PaCMAPConfig;pub use config::Quantization;pub use error::PaCMAPError;
Modules§
- adam
- Adam optimizer step for the 2-D embedding.
- config
- Configuration types for a PaCMAP embedding run.
- error
- Error types for flow-pacmap.
- gradient
- PaCMAP loss gradient computation (Algorithm 1, Wang et al. 2021).
- knn
- K-nearest-neighbour search for PaCMAP graph construction.
- pairs
- Near, mid-near, and further pair construction from Algorithm 1.
- pca
- PCA initialisation via faer SVD on the d×d covariance matrix.
- weights
- Three-phase weight schedule from Algorithm 1 of Wang et al. 2021.
Structs§
- PaCMAP
Progress - Progress event emitted during optimization.
Functions§
- fit_
transform - Embed
n × drow-major f32 data into 2 dimensions.