public interface IClusteringModel
Modifier and Type | Method and Description |
---|---|
int |
distances(double[] row,
double[] distances)
Calculates squared distances to all cluster centers.
|
int |
getNumClusters()
Returns number of cluster used by this model.
|
double[] |
score0(double[] row,
double[] preds) |
double[] score0(double[] row, double[] preds)
int distances(double[] row, double[] distances)
hex.genmodel.GenModel.KMeans_distances(..)
for precise definition
of the distance metric.
Pass in data in a double[], in a same way as to the score0 function.
Cluster distances will be stored into the distances[] array. Function
will return the closest cluster. This way the caller can avoid to call
score0(..) to retrieve the cluster where the data point belongs.
Warning: This function can modify content of row array (same as for score0).row
- input rowdistances
- vector of distancesint getNumClusters()