@Test(expected = Test.None.class) public void testGaussianMixture() throws Exception { System.out.println("Gaussian Mixture"); double[][] x = GaussianMixture.x; int[] y = GaussianMixture.y; DBSCAN<double[]> model = DBSCAN.fit(x,200, 0.8); 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%%, adjusted rand index = %.2f%%%n", 100.0 * r, 100.0 * r2); assertEquals(0.5424, r, 1E-4); assertEquals(0.1215, 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 DBSCAN<double[]> fit(double[][] data, int minPts, double radius) { return fit(data, new KDTree<>(data, data), minPts, radius); }
DBSCAN extends PartitionClustering { public static DBSCAN<double[]> fit(double[][] data, int minPts, double radius) { return fit(data, new KDTree<>(data, data), minPts, radius); } }
DBSCAN extends PartitionClustering { public static DBSCAN<double[]> fit(double[][] data, int minPts, double radius) { return fit(data, new KDTree<>(data, data), minPts, radius); } DBSCAN(int minPts, double radius, RNNSearch<T,T> nns, int k, int[] y); }
DBSCAN extends PartitionClustering { public static DBSCAN<double[]> fit(double[][] data, int minPts, double radius) { return fit(data, new KDTree<>(data, data), minPts, radius); } DBSCAN(int minPts, double radius, RNNSearch<T,T> nns, int k, int[] y); static DBSCAN<double[]> fit(double[][] data, int minPts, double radius); static DBSCAN<T> fit(T[] data, Distance<T> distance, int minPts, double radius); static DBSCAN<T> fit(T[] data, RNNSearch<T,T> nns, int minPts, double radius); int predict(T x); }
DBSCAN extends PartitionClustering { public static DBSCAN<double[]> fit(double[][] data, int minPts, double radius) { return fit(data, new KDTree<>(data, data), minPts, radius); } DBSCAN(int minPts, double radius, RNNSearch<T,T> nns, int k, int[] y); static DBSCAN<double[]> fit(double[][] data, int minPts, double radius); static DBSCAN<T> fit(T[] data, Distance<T> distance, int minPts, double radius); static DBSCAN<T> fit(T[] data, RNNSearch<T,T> nns, int minPts, double radius); int predict(T x); final double minPts; final double radius; }