avila_clustering/lib.rs
1//! # avila-clustering
2//!
3//! State-of-the-art clustering algorithms for Rust, designed to surpass
4//! scikit-learn, HDBSCAN, and RAPIDS cuML in performance and capabilities.
5//!
6//! ## Features
7//!
8//! - **Partitional Clustering**: KMeans, KMedoids, Fuzzy C-Means, Mean Shift
9//! - **Density-Based**: DBSCAN, HDBSCAN, OPTICS, DENCLUE
10//! - **Hierarchical**: Agglomerative, Divisive, BIRCH
11//! - **Model-Based**: GMM, Bayesian GMM, Dirichlet Process GMM
12//! - **Graph-Based**: Spectral Clustering, Louvain, Leiden
13//! - **Scientific**: 4D clustering, curved manifolds, streaming, GPU acceleration
14
15pub mod algorithms;
16pub mod gpu;
17pub mod metrics;
18pub mod prelude;
19pub mod scientific;
20
21pub use prelude::*;
22
23/// Common error type for clustering operations
24#[derive(Debug, thiserror::Error)]
25pub enum ClusteringError {
26 #[error("Invalid parameter: {0}")]
27 InvalidParameter(String),
28
29 #[error("Convergence failed after {0} iterations")]
30 ConvergenceFailure(usize),
31
32 #[error("Shape mismatch: expected {expected}, got {actual}")]
33 ShapeMismatch { expected: String, actual: String },
34
35 #[error("Numerical error: {0}")]
36 NumericalError(String),
37
38 #[error("GPU error: {0}")]
39 GpuError(String),
40}
41
42pub type Result<T> = std::result::Result<T, ClusteringError>;