public class DoubleKMeans extends java.lang.Object implements DensityFunction<double[]>
| Constructor and Description |
|---|
DoubleKMeans(int k)
Constructor with number of clusters
|
| Modifier and Type | Method and Description |
|---|---|
double[] |
distanceToMean(double[] e)
Return an array containing the squared distances to each clusters
|
void |
train(double[] e)
Adds a sample to the training set and train the density function
|
void |
train(java.util.List<double[]> train)
Train the density function on the specified training set
|
double |
valueOf(double[] e)
Value of the density function for the specified sample
|
public DoubleKMeans(int k)
k - number of clusterspublic void train(double[] e)
DensityFunctiontrain in interface DensityFunction<double[]>e - the sample to add to the training setpublic void train(java.util.List<double[]> train)
DensityFunctiontrain in interface DensityFunction<double[]>train - the list of training samplespublic double valueOf(double[] e)
DensityFunctionvalueOf in interface DensityFunction<double[]>e - the sample to evaluatepublic double[] distanceToMean(double[] e)
e - the sample to evaluate