public class KMeansModel extends Object implements ClusterizationModel<Vector,Integer>, Exportable<KMeansModelFormat>
| Constructor and Description |
|---|
KMeansModel(Vector[] centers,
DistanceMeasure distanceMeasure)
Construct KMeans model with given centers and distanceMeasure measure.
|
| Modifier and Type | Method and Description |
|---|---|
Integer |
apply(Vector vec)
Predict closest center index for a given vector.
|
DistanceMeasure |
distanceMeasure()
Distance measure.
|
boolean |
equals(Object obj) |
int |
getAmountOfClusters()
Amount of centers in clusterization.
|
Vector[] |
getCenters()
Get centers of clusters.
|
int |
hashCode() |
<P> void |
saveModel(Exporter<KMeansModelFormat,P> exporter,
P path)
Save model by the given path.
|
String |
toString() |
String |
toString(boolean pretty) |
public KMeansModel(Vector[] centers, DistanceMeasure distanceMeasure)
centers - Centers.distanceMeasure - Distance measure.public DistanceMeasure distanceMeasure()
public int getAmountOfClusters()
getAmountOfClusters in interface ClusterizationModel<Vector,Integer>public Vector[] getCenters()
getCenters in interface ClusterizationModel<Vector,Integer>public <P> void saveModel(Exporter<KMeansModelFormat,P> exporter, P path)
saveModel in interface Exportable<KMeansModelFormat>exporter - Exporter.path - Path to saved model.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019