[][src]Function appr_dbscan::do_appr_dbscan_auto_dimensionality_points

pub fn do_appr_dbscan_auto_dimensionality_points(
    points: Vec<VectorPoint>,
    epsilon: f64,
    rho: f64,
    min_pts: usize
) -> (VectorDBSCANResult, usize)

Function that returns the result of the approximate DBSCAN algorithm without prior knowledge of the points dimensionality , executed on the set of points contained in vector points with the given values of epsilon, rho and min_pts.

Arguments

  • points: the vector of points to execute the algorithm on. All points must be vectors of the same length in order to be points from the same space.
  • 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'.

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 a vector of f64, contrary to the other functions, along with the detected dimensionality. 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_auto_dimensionality_points;

let points = vec![vec![0.0,0.0],vec![1.0,1.0],vec![0.0,1.0],vec![1.0,0.0],vec![2.0,1.0],vec![0.0,2.0],vec![2.0,1.0],vec![1.0,1.0]];
let (res, dimensionality) = do_appr_dbscan_auto_dimensionality_points(points, 0.3, 0.1, 10);
let clusters_count = res.len() - 1;
let noise_points_count = res[0].len();