mlpack 3.4.2
dbscan.hpp
Go to the documentation of this file.
1
13#ifndef MLPACK_METHODS_DBSCAN_DBSCAN_HPP
14#define MLPACK_METHODS_DBSCAN_DBSCAN_HPP
15
16#include <mlpack/core.hpp>
21#include <boost/dynamic_bitset.hpp>
22
23namespace mlpack {
24namespace dbscan {
25
51template<typename RangeSearchType = range::RangeSearch<>,
52 typename PointSelectionPolicy = OrderedPointSelection>
53class DBSCAN
54{
55 public:
69 DBSCAN(const double epsilon,
70 const size_t minPoints,
71 const bool batchMode = true,
72 RangeSearchType rangeSearch = RangeSearchType(),
73 PointSelectionPolicy pointSelector = PointSelectionPolicy());
74
83 template<typename MatType>
84 size_t Cluster(const MatType& data,
85 arma::mat& centroids);
86
96 template<typename MatType>
97 size_t Cluster(const MatType& data,
98 arma::Row<size_t>& assignments);
99
110 template<typename MatType>
111 size_t Cluster(const MatType& data,
112 arma::Row<size_t>& assignments,
113 arma::mat& centroids);
114
115 private:
117 double epsilon;
118
121 size_t minPoints;
122
124 bool batchMode;
125
127 RangeSearchType rangeSearch;
128
130 PointSelectionPolicy pointSelector;
131
142 template<typename MatType>
143 void PointwiseCluster(const MatType& data,
144 emst::UnionFind& uf);
145
155 template<typename MatType>
156 void BatchCluster(const MatType& data,
157 emst::UnionFind& uf);
158};
159
160} // namespace dbscan
161} // namespace mlpack
162
163// Include implementation.
164#include "dbscan_impl.hpp"
165
166#endif
DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is a clustering technique descri...
Definition: dbscan.hpp:54
size_t Cluster(const MatType &data, arma::Row< size_t > &assignments)
Performs DBSCAN clustering on the data, returning number of clusters and also the list of cluster ass...
size_t Cluster(const MatType &data, arma::mat &centroids)
Performs DBSCAN clustering on the data, returning number of clusters and also the centroid of each cl...
size_t Cluster(const MatType &data, arma::Row< size_t > &assignments, arma::mat &centroids)
Performs DBSCAN clustering on the data, returning number of clusters, the centroid of each cluster an...
DBSCAN(const double epsilon, const size_t minPoints, const bool batchMode=true, RangeSearchType rangeSearch=RangeSearchType(), PointSelectionPolicy pointSelector=PointSelectionPolicy())
Construct the DBSCAN object with the given parameters.
A Union-Find data structure.
Definition: union_find.hpp:31
Include all of the base components required to write mlpack methods, and the main mlpack Doxygen docu...
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1