[−][src]Function appr_dbscan::do_appr_dbscan_points
pub fn do_appr_dbscan_points<const D: usize>(
points: Vec<Point<D>>,
epsilon: f64,
rho: f64,
min_pts: usize
) -> DBSCANResult<D>
Function that returns the result of the approximate DBSCAN algorithm
executed on the set of points contained in points
with the given values of epsilon and rho.
Arguments
points
: the vector of points to execute the algorithm on. All points must be arrays of lenghtD
epsilon
: the radius for the DBSCAN algorithm.rho
: the approximation factor. The smaller it is the more precise the result. Usual values are 0.1 and 0.01.min_pts
: the minimum number of nearby points required by the DBSCAN algorithm to declare an area as 'dense'.
Constant argument
D
: The dimensionality of each point in the data.
Return value
This function returns a vector of clusters, where each cluster is a vector of the points contained in it. Each point is stored as an array of f64 ([f64;D]
).
The element at index 0
is the collection of all noise points, while all the other elements are the actual clusters.
Example
extern crate appr_dbscan; use appr_dbscan::do_appr_dbscan_points; use appr_dbscan::utils::DBSCANResult; let points = vec![[0.0,0.0],[1.0,1.0],[0.0,1.0],[1.0,0.0],[2.0,1.0],[0.0,2.0],[2.0,1.0],[1.0,1.0]]; let res : DBSCANResult<2> = do_appr_dbscan_points(points, 0.3, 0.1, 10); let clusters_count = res.len() - 1; let noise_points_count = res[0].len();