public class KMeansMojoModel extends MojoModel implements IClusteringModel
_algoName, _balanceClasses, _category, _defaultThreshold, _h2oVersion, _modelAttributes, _modelClassDistrib, _modelDescriptor, _mojo_version, _nclasses, _nfeatures, _priorClassDistrib, _reproducibilityInformation, _supervised, _uuid
_domains, _foldColumn, _names, _offsetColumn, _responseColumn, _treatmentColumn
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)
Subclasses implement the scoring logic.
|
getModelCategory, getUUID, isSupervised, load, load, load, nclasses, nfeatures
bitSetContains, bitSetIsInRange, calibrateClassProbabilities, convertDouble2Float, correctProbabilities, createAuxKey, features, GBM_rescale, getCategoricalEncoding, getColIdx, getDomainValues, getDomainValues, getDomainValues, getHeader, getModelCategories, getNames, getNumClasses, getNumCols, getNumResponseClasses, getOffsetName, getOrigDomainValues, getOrigNames, getOrigNumCols, getOrigProjectionArray, getOutputDomains, getOutputNames, getPrediction, getPredictionBinomial, getPredictionMultinomial, getPredsSize, getPredsSize, getResponseIdx, getResponseName, GLM_identityInv, GLM_inverseInv, GLM_logInv, GLM_logitInv, GLM_ologitInv, GLM_tweedieInv, img2pixels, internal_threadSafeInstance, isAutoEncoder, isClassifier, KMeans_closest, KMeans_distance, KMeans_distance, KMeans_distances, Kmeans_preprocessData, Kmeans_preprocessData, KMeans_simplex, log_rescale, mapEnum, nCatFeatures, requiresOffset, score0, setCats, setCats, setInput, setInput
public double[] score0(double[] row, double[] preds)
GenModel
score0
in interface IClusteringModel
score0
in class GenModel
public int distances(double[] row, double[] distances)
IClusteringModel
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).distances
in interface IClusteringModel
row
- input rowdistances
- vector of distancespublic int getNumClusters()
IClusteringModel
getNumClusters
in interface IClusteringModel