Class DBSCANClusterer<T extends Clusterable<T>>
- Type Parameters:
T
- type of the points to cluster
The DBSCAN algorithm forms clusters based on the idea of density connectivity, i.e. a point p is density connected to another point q, if there exists a chain of points pi, with i = 1 .. n and p1 = p and pn = q, such that each pair <pi, pi+1> is directly density-reachable. A point q is directly density-reachable from point p if it is in the ε-neighborhood of this point.
Any point that is not density-reachable from a formed cluster is treated as noise, and will thus not be present in the result.
The algorithm requires two parameters:
- eps: the distance that defines the ε-neighborhood of a point
- minPoints: the minimum number of density-connected points required to form a cluster
Note: as DBSCAN is not a centroid-based clustering algorithm, the resulting
Cluster
objects will have no defined center, i.e. Cluster.getCenter()
will
return null
.
- Since:
- 3.1
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static enum
Deprecated.Status of a point during the clustering process. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDBSCANClusterer
(double eps, int minPts) Deprecated.Creates a new instance of a DBSCANClusterer. -
Method Summary
Modifier and TypeMethodDescriptioncluster
(Collection<T> points) Deprecated.Performs DBSCAN cluster analysis.expandCluster
(Cluster<T> cluster, T point, List<T> neighbors, Collection<T> points, Map<Clusterable<T>, DBSCANClusterer.PointStatus> visited) Deprecated.Expands the cluster to include density-reachable items.double
getEps()
Deprecated.Returns the maximum radius of the neighborhood to be considered.int
Deprecated.Returns the minimum number of points needed for a cluster.getNeighbors
(T point, Collection<T> points) Deprecated.Returns a list of density-reachable neighbors of apoint
.Deprecated.Merges two lists together.
-
Field Details
-
eps
private final double epsDeprecated.Maximum radius of the neighborhood to be considered. -
minPts
private final int minPtsDeprecated.Minimum number of points needed for a cluster.
-
-
Constructor Details
-
DBSCANClusterer
Deprecated.Creates a new instance of a DBSCANClusterer.- Parameters:
eps
- maximum radius of the neighborhood to be consideredminPts
- minimum number of points needed for a cluster- Throws:
NotPositiveException
- ifeps < 0.0
orminPts < 0
-
-
Method Details
-
getEps
public double getEps()Deprecated.Returns the maximum radius of the neighborhood to be considered.- Returns:
- maximum radius of the neighborhood
-
getMinPts
public int getMinPts()Deprecated.Returns the minimum number of points needed for a cluster.- Returns:
- minimum number of points needed for a cluster
-
cluster
Deprecated.Performs DBSCAN cluster analysis.Note: as DBSCAN is not a centroid-based clustering algorithm, the resulting
Cluster
objects will have no defined center, i.e.Cluster.getCenter()
will returnnull
.- Parameters:
points
- the points to cluster- Returns:
- the list of clusters
- Throws:
NullArgumentException
- if the data points are null
-
expandCluster
private Cluster<T> expandCluster(Cluster<T> cluster, T point, List<T> neighbors, Collection<T> points, Map<Clusterable<T>, DBSCANClusterer.PointStatus> visited) Deprecated.Expands the cluster to include density-reachable items.- Parameters:
cluster
- Cluster to expandpoint
- Point to add to clusterneighbors
- List of neighborspoints
- the data setvisited
- the set of already visited points- Returns:
- the expanded cluster
-
getNeighbors
Deprecated.Returns a list of density-reachable neighbors of apoint
.- Parameters:
point
- the point to look forpoints
- possible neighbors- Returns:
- the List of neighbors
-
merge
Deprecated.Merges two lists together.- Parameters:
one
- first listtwo
- second list- Returns:
- merged lists
-
DBSCANClusterer
instead