[mlpack] 80/207: Update dbscan.hpp
Barak A. Pearlmutter
barak+git at pearlmutter.net
Thu Mar 23 17:53:42 UTC 2017
This is an automated email from the git hooks/post-receive script.
bap pushed a commit to branch master
in repository mlpack.
commit 6ed31564ce3296e30cdfa73bf69d3d0272ff1db3
Author: Sudhanshu Ranjan <pihooji at gmail.com>
Date: Sat Jan 21 09:21:24 2017 +0530
Update dbscan.hpp
---
src/mlpack/methods/dbscan/dbscan.hpp | 57 ++++++++++++++++++++++++++++++++++--
1 file changed, 55 insertions(+), 2 deletions(-)
diff --git a/src/mlpack/methods/dbscan/dbscan.hpp b/src/mlpack/methods/dbscan/dbscan.hpp
index abe11d2..af9d95f 100644
--- a/src/mlpack/methods/dbscan/dbscan.hpp
+++ b/src/mlpack/methods/dbscan/dbscan.hpp
@@ -32,27 +32,80 @@ class DBSCAN
RangeSearchType rangeSearch = RangeSearchType(),
PointSelectionPolicy pointSelector = PointSelectionPolicy());
+ /**
+ * Performs DBSCAN clustering on the data, returning number of clusters
+ * and also the centroid of each cluster.
+ *
+ * @param MatType Type of matrix (arma::mat or arma::sp_mat).
+ * @param data Dataset to cluster.
+ * @param centroids Matrix in which centroids are stored.
+ */
template<typename MatType>
size_t Cluster(const MatType& data,
arma::mat& centroids);
+ /**
+ * Performs DBSCAN clustering on the data, returning number of clusters
+ * and also the list of cluster assignments.
+ *
+ * @param MatType Type of matrix (arma::mat or arma::sp_mat).
+ * @param data Dataset to cluster.
+ * @param assignments Vector to store cluster assignments.
+ */
template<typename MatType>
size_t Cluster(const MatType& data,
arma::Row<size_t>& assignments);
- //! If assignments[i] == assignments.n_elem - 1, then the point is considered
- //! "noise".
+ /**
+ * Performs DBSCAN clustering on the data, returning number of clusters,
+ * the centroid of each cluster and also the list of cluster assignments.
+ * !If assignments[i] == assignments.n_elem - 1, then the point is considered
+ * !"noise".
+ *
+ * @param MatType Type of matrix (arma::mat or arma::sp_mat).
+ * @param data Dataset to cluster.
+ * @param assignments Vector to store cluster assignments.
+ * @param centroids Matrix in which centroids are stored.
+ */
template<typename MatType>
size_t Cluster(const MatType& data,
arma::Row<size_t>& assignments,
arma::mat& centroids);
private:
+ // Maximum distance between two points to be part of same cluster.
double epsilon;
+
+ // Minimum number of points to be in the epsilon-neighborhood(including
+ // itself) for the point to be a core-point.
size_t minPoints;
+
+ // Instantiated range search policy.
RangeSearchType rangeSearch;
+
+ // Instantiated point selection policy.
PointSelectionPolicy pointSelector;
+ /**
+ * This function processes the point at index. It marks the point
+ * as visited, checks if the given point is core or non-core.
+ * If its a core point, it expands the cluster else returns.
+ *
+ *
+ * @param MatType Type of matrix (arma::mat or arma::sp_mat).
+ * @param data Dataset to cluster.
+ * @param unvisited Remembers if a point has been visited.
+ * @param index Index of point to be visited now.
+ * @param assignments Vector to store cluster assignments.
+ * @param currentCluster Index of cluster which will be
+ * assigned to points in current cluster.
+ * @param neighbor Matrix containing list of neighbors for each point
+ * which fall in its epsilon-neighborhood.
+ * @param distances Matrix containing list of distances for each point
+ * which fall in its epsilon-neighborhood.
+ * @param topLevel If true, then current point is the first point in
+ * the current cluster, helps in detecting noise.
+ */
template<typename MatType>
size_t ProcessPoint(const MatType& data,
boost::dynamic_bitset<>& unvisited,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git
More information about the debian-science-commits
mailing list