public class DeterministicAnnealing extends CentroidClustering<double[],double[]>
centroids, distortion
k, OUTLIER, size, y
Constructor and Description |
---|
DeterministicAnnealing(double distortion,
double[][] centroids,
int[] y)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected double |
distance(double[] x,
double[] y)
The distance function.
|
static DeterministicAnnealing |
fit(double[][] data,
int Kmax)
Clustering data into k clusters.
|
static DeterministicAnnealing |
fit(double[][] data,
int Kmax,
double alpha,
int maxIter,
double tol,
double splitTol)
Clustering data into k clusters.
|
compareTo, predict, toString
run, seed
public DeterministicAnnealing(double distortion, double[][] centroids, int[] y)
distortion
- the total distortion.centroids
- the centroids of each cluster.y
- the cluster labels.protected double distance(double[] x, double[] y)
CentroidClustering
distance
in class CentroidClustering<double[],double[]>
public static DeterministicAnnealing fit(double[][] data, int Kmax)
data
- the input data of which each row is an observation.Kmax
- the maximum number of clusters.public static DeterministicAnnealing fit(double[][] data, int Kmax, double alpha, int maxIter, double tol, double splitTol)
data
- the input data of which each row is an observation.Kmax
- the maximum number of clusters.alpha
- the temperature T is decreasing as T = T * alpha.
alpha has to be in (0, 1).maxIter
- the maximum number of iterations at each temperature.tol
- the tolerance of convergence test.splitTol
- the tolerance to split a cluster.