@Test(expected = Test.None.class) public void testGaussianMixture() throws Exception { System.out.println("Gaussian Mixture"); double[][] x = GaussianMixture.x; int[] y = GaussianMixture.y; MathEx.setSeed(19650218); DENCLUE model = DENCLUE.fit(x, 0.85, 100); System.out.println(model); double r = RandIndex.of(y, model.y); double r2 = AdjustedRandIndex.of(y, model.y); System.out.println("The number of clusters: " + model.k); System.out.format("Training rand index = %.2f%%, adjusted rand index = %.2f%%%n", 100.0 * r, 100.0 * r2); assertEquals(0.6080, r, 1E-4); assertEquals(0.2460, r2, 1E-4); System.out.format("MI = %.2f%n", MutualInformation.of(y, model.y)); System.out.format("NMI.joint = %.2f%%%n", 100 * NormalizedMutualInformation.joint(y, model.y)); System.out.format("NMI.max = %.2f%%%n", 100 * NormalizedMutualInformation.max(y, model.y)); System.out.format("NMI.min = %.2f%%%n", 100 * NormalizedMutualInformation.min(y, model.y)); System.out.format("NMI.sum = %.2f%%%n", 100 * NormalizedMutualInformation.sum(y, model.y)); System.out.format("NMI.sqrt = %.2f%%%n", 100 * NormalizedMutualInformation.sqrt(y, model.y)); java.nio.file.Path temp = smile.data.Serialize.write(model); smile.data.Serialize.read(temp); }
public static DENCLUE fit(double[][] data, double sigma, int m) { int n = data.length; return fit(data, sigma, m, 1E-2, Math.max(10, n/200)); }
DENCLUE extends PartitionClustering { public static DENCLUE fit(double[][] data, double sigma, int m) { int n = data.length; return fit(data, sigma, m, 1E-2, Math.max(10, n/200)); } }
DENCLUE extends PartitionClustering { public static DENCLUE fit(double[][] data, double sigma, int m) { int n = data.length; return fit(data, sigma, m, 1E-2, Math.max(10, n/200)); } DENCLUE(int k, double[][] attractors, double[] radius, double[][] samples, double sigma, int[] y, double tol); }
DENCLUE extends PartitionClustering { public static DENCLUE fit(double[][] data, double sigma, int m) { int n = data.length; return fit(data, sigma, m, 1E-2, Math.max(10, n/200)); } DENCLUE(int k, double[][] attractors, double[] radius, double[][] samples, double sigma, int[] y, double tol); static DENCLUE fit(double[][] data, double sigma, int m); static DENCLUE fit(double[][] data, double sigma, int m, double tol, int minPts); int predict(double[] x); }
DENCLUE extends PartitionClustering { public static DENCLUE fit(double[][] data, double sigma, int m) { int n = data.length; return fit(data, sigma, m, 1E-2, Math.max(10, n/200)); } DENCLUE(int k, double[][] attractors, double[] radius, double[][] samples, double sigma, int[] y, double tol); static DENCLUE fit(double[][] data, double sigma, int m); static DENCLUE fit(double[][] data, double sigma, int m, double tol, int minPts); int predict(double[] x); final double[][] attractors; }