/** * Convenience method to quickly create an exact {@link DoubleKMeans}. All * parameters other than the number of clusters and number * of iterations are set at their defaults, but can be manipulated through * the configuration returned by {@link #getConfiguration()}. * <p> * Euclidean distance is used to measure the distance between points. * * @param K * the number of clusters * @param niters * maximum number of iterations * @return a {@link DoubleKMeans} instance configured for exact k-means */ public static DoubleKMeans createExact(int K, int niters) { final KMeansConfiguration<DoubleNearestNeighbours, double[]> conf = new KMeansConfiguration<DoubleNearestNeighbours, double[]>(K, new DoubleNearestNeighboursExact.Factory(), niters); return new DoubleKMeans(conf); }
/** * Convenience method to quickly create an exact {@link DoubleKMeans}. All * parameters other than the number of clusters are set * at their defaults, but can be manipulated through the configuration * returned by {@link #getConfiguration()}. * <p> * Euclidean distance is used to measure the distance between points. * * @param K * the number of clusters * @return a {@link DoubleKMeans} instance configured for exact k-means */ public static DoubleKMeans createExact(int K) { final KMeansConfiguration<DoubleNearestNeighbours, double[]> conf = new KMeansConfiguration<DoubleNearestNeighbours, double[]>(K, new DoubleNearestNeighboursExact.Factory()); return new DoubleKMeans(conf); }
private static DoubleSpectralClustering prepareSpectralClustering() { // Creater the spectral clustering double epss = 0.6; SpatialClusterer<DoubleDBSCANClusters,double[]> inner = new DoubleNNDBSCAN(epss, 2,new DoubleNearestNeighboursExact.Factory(DoubleFVComparison.EUCLIDEAN)); SpectralClusteringConf<double[]> conf = new SpectralClusteringConf<double[]>( inner ); // conf.eigenChooser = new AutoSelectingEigenChooser(100, 1.0); conf.eigenChooser = new HardCodedEigenChooser(10); DoubleSpectralClustering clust = new DoubleSpectralClustering(conf); return clust; }
/** * @param eps * @param minPts */ public DoubleNNDBSCAN(double eps, int minPts) { this(eps,minPts,new DoubleNearestNeighboursExact.Factory()); } class NNRegionMode implements RegionMode<IntDoublePair>{
private static DoubleSpectralClustering prepareSpectralClustering() { // Creater the spectral clustering double epss = 0.6; SpatialClusterer<DoubleDBSCANClusters,double[]> inner = new DoubleNNDBSCAN(epss, 2,new DoubleNearestNeighboursExact.Factory(DoubleFVComparison.EUCLIDEAN)); SpectralClusteringConf<double[]> conf = new SpectralClusteringConf<double[]>( inner ); // conf.eigenChooser = new AutoSelectingEigenChooser(100, 1.0); conf.eigenChooser = new HardCodedEigenChooser(10); DoubleSpectralClustering clust = new DoubleSpectralClustering(conf); return clust; }