@Test(expected = Test.None.class) public void testUSPS() throws Exception { System.out.println("USPS"); MathEx.setSeed(19650218); double[][] x = USPS.x; int[] y = USPS.y; SpectralClustering model = SpectralClustering.fit(x, 10, 8.0); System.out.println(model); double r = RandIndex.of(y, model.y); double r2 = AdjustedRandIndex.of(y, model.y); System.out.format("Training rand index = %.2f%%\tadjusted rand index = %.2f%%%n", 100.0 * r, 100.0 * r2); assertEquals(0.9128, r, 1E-4); assertEquals(0.5371, 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)); }
public static SpectralClustering fit(Matrix W, int k) { return fit(W, k, 100, 1E-4); }
SpectralClustering extends PartitionClustering implements Serializable { public static SpectralClustering fit(Matrix W, int k) { return fit(W, k, 100, 1E-4); } }
SpectralClustering extends PartitionClustering implements Serializable { public static SpectralClustering fit(Matrix W, int k) { return fit(W, k, 100, 1E-4); } SpectralClustering(double distortion, int k, int[] y); }
SpectralClustering extends PartitionClustering implements Serializable { public static SpectralClustering fit(Matrix W, int k) { return fit(W, k, 100, 1E-4); } SpectralClustering(double distortion, int k, int[] y); static SpectralClustering fit(Matrix W, int k); static SpectralClustering fit(Matrix W, int k, int maxIter, double tol); static SpectralClustering fit(double[][] data, int k, double sigma); static SpectralClustering fit(double[][] data, int k, double sigma, int maxIter, double tol); static SpectralClustering fit(double[][] data, int k, int l, double sigma); static SpectralClustering fit(double[][] data, int k, int l, double sigma, int maxIter, double tol); }
SpectralClustering extends PartitionClustering implements Serializable { public static SpectralClustering fit(Matrix W, int k) { return fit(W, k, 100, 1E-4); } SpectralClustering(double distortion, int k, int[] y); static SpectralClustering fit(Matrix W, int k); static SpectralClustering fit(Matrix W, int k, int maxIter, double tol); static SpectralClustering fit(double[][] data, int k, double sigma); static SpectralClustering fit(double[][] data, int k, double sigma, int maxIter, double tol); static SpectralClustering fit(double[][] data, int k, int l, double sigma); static SpectralClustering fit(double[][] data, int k, int l, double sigma, int maxIter, double tol); final double distortion; }