public class GMeans extends CentroidClustering<double[],double[]>
KMeans
,
XMeans
,
Serialized Formcentroids, distortion
k, OUTLIER, size, y
Constructor and Description |
---|
GMeans(double distortion,
double[][] centroids,
int[] y)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
distance(double[] x,
double[] y)
The distance function.
|
static GMeans |
fit(double[][] data,
int kmax)
Clustering data with the number of clusters
determined by G-Means algorithm automatically.
|
static GMeans |
fit(double[][] data,
int kmax,
int maxIter,
double tol)
Clustering data with the number of clusters
determined by G-Means algorithm automatically.
|
compareTo, predict, toString
run, seed
public GMeans(double distortion, double[][] centroids, int[] y)
distortion
- the total distortion.centroids
- the centroids of each cluster.y
- the cluster labels.public double distance(double[] x, double[] y)
CentroidClustering
distance
in class CentroidClustering<double[],double[]>
public static GMeans fit(double[][] data, int kmax)
data
- the input data of which each row is an observation.kmax
- the maximum number of clusters.public static GMeans fit(double[][] data, int kmax, int maxIter, double tol)
data
- the input data of which each row is an observation.kmax
- the maximum number of clusters.maxIter
- the maximum number of iterations for k-means.tol
- the tolerance of k-means convergence test.