T
- the type of points that can be clusteredpublic abstract class Clusterer<T extends Clusterable> extends Object
Modifier | Constructor and Description |
---|---|
protected |
Clusterer(DistanceMeasure measure)
Build a new clusterer with the given
DistanceMeasure . |
Modifier and Type | Method and Description |
---|---|
abstract List<? extends Cluster<T>> |
cluster(Collection<T> points)
Perform a cluster analysis on the given set of
Clusterable instances. |
protected double |
distance(Clusterable p1,
Clusterable p2)
Calculates the distance between two
Clusterable instances
with the configured DistanceMeasure . |
DistanceMeasure |
getDistanceMeasure()
Returns the
DistanceMeasure instance used by this clusterer. |
protected Clusterer(DistanceMeasure measure)
DistanceMeasure
.measure
- the distance measure to usepublic abstract List<? extends Cluster<T>> cluster(Collection<T> points) throws MathIllegalArgumentException, MathIllegalStateException
Clusterable
instances.points
- the set of Clusterable
instancesList
of clustersMathIllegalArgumentException
- if points are null or the number of
data points is not compatible with this clustererMathIllegalStateException
- if the algorithm has not yet converged after
the maximum number of iterations has been exceededpublic DistanceMeasure getDistanceMeasure()
DistanceMeasure
instance used by this clusterer.protected double distance(Clusterable p1, Clusterable p2)
Clusterable
instances
with the configured DistanceMeasure
.p1
- the first clusterablep2
- the second clusterableCopyright © 2016 Hipparchus.org. All rights reserved.