Crate fuzzy_dbscan[−][src]
An implementation of the FuzzyDBSCAN algorithm.
Example
extern crate fuzzy_dbscan; #[derive(Debug)] struct Point { x: f32, y: f32, } fn euclidean_distance(a: &Point, b: &Point) -> f32 { ((b.x - a.x).powi(2) + (b.y - a.y).powi(2)).sqrt() } fn main() { let points = vec![ Point { x: 0.0, y: 0.0 }, Point { x: 100.0, y: 100.0 }, Point { x: 105.0, y: 105.0 }, Point { x: 115.0, y: 115.0 }, ]; let fuzzy_dbscan = fuzzy_dbscan::FuzzyDBSCAN::<Point> { distance_fn: &euclidean_distance, eps_min: 10.0, eps_max: 20.0, pts_min: 1.0, pts_max: 2.0, }; println!("{:?}", fuzzy_dbscan.cluster(&points)); }
Structs
Assignment |
An element of a cluster. |
FuzzyDBSCAN |
An instance of the FuzzyDBSCAN algorithm. |
Enums
Category |
A high-level classification, as defined by the FuzzyDBSCAN algorithm. |
Type Definitions
Cluster |
A group of assigned points. |