[−][src]Function appr_dbscan::do_appr_dbscan_file
pub fn do_appr_dbscan_file<P, const D: usize>(
filename: P,
epsilon: f64,
rho: f64,
min_pts: usize
) -> DBSCANResult<D> where
P: AsRef<Path>,
Function that returns the result of the approximate DBSCAN algorithm
executed on the set of points contained in filename
with the given values of epsilon and rho.
Arguments
filename
: the path to the file containing the data points. The file should be formatted with one point per line and the values for each coordinate should be separated by a white space. Only numerical coordinates values are accepted.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 file.
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_file; use appr_dbscan::utils::DBSCANResult; let res : DBSCANResult<2> = do_appr_dbscan_file("./datasets/out_test_1.txt", 0.3, 0.1, 10); let clusters_count = res.len() - 1; let noise_points_count = res[0].len();