/** * Convenience method for backwards compatibility * */ public static Path buildClusters(Configuration conf, Path input, Path output, DistanceMeasure measure, double t1, double t2, int clusterFilter, boolean runSequential) throws IOException, InterruptedException, ClassNotFoundException { return buildClusters(conf, input, output, measure, t1, t2, t1, t2, clusterFilter, runSequential); }
/** * Convenience method to provide backward compatibility */ public static void run(Configuration conf, Path input, Path output, DistanceMeasure measure, double t1, double t2, boolean runClustering, double clusterClassificationThreshold, boolean runSequential) throws IOException, InterruptedException, ClassNotFoundException { run(conf, input, output, measure, t1, t2, t1, t2, 0, runClustering, clusterClassificationThreshold, runSequential); }
@Override public String getIdentifier() { return "C-" + getId(); } }
for (int i = 0; i < c.length; i++) { c[i] = new Canopy(); }
/** * Create a new Canopy containing the given point and canopyId * * @param center a point in vector space * @param canopyId an int identifying the canopy local to this process only * @param measure a DistanceMeasure to use */ public Canopy(Vector center, int canopyId, DistanceMeasure measure) { super(center, canopyId, measure); observe(center); }
/** * Iterate through the canopies, resetting their center to their centroids * * @param canopies * a List<Canopy> */ public static void updateCentroids(Iterable<Canopy> canopies) { for (Canopy canopy : canopies) { canopy.computeParameters(); } }
@Override protected void map(WritableComparable<?> key, VectorWritable point, Context context) throws IOException, InterruptedException { canopyClusterer.addPointToCanopies(point.get(), canopies); }
public CanopyClusterer(Configuration config) { this.configure(config); }
/** * Print the canopies to the transcript * * @param canopies * a List<Canopy> */ private static void printCanopies(Iterable<Canopy> canopies) { for (Canopy canopy : canopies) { System.out.println(canopy.asFormatString(null)); } }
/** * Convenience method to provide backward compatibility */ public static void run(Configuration conf, Path input, Path output, DistanceMeasure measure, double t1, double t2, boolean runClustering, double clusterClassificationThreshold, boolean runSequential) throws IOException, InterruptedException, ClassNotFoundException { run(conf, input, output, measure, t1, t2, t1, t2, 0, runClustering, clusterClassificationThreshold, runSequential); }
@Override public String getIdentifier() { return "C-" + getId(); } }
/** * Convenience method for backwards compatibility * */ public static Path buildClusters(Configuration conf, Path input, Path output, DistanceMeasure measure, double t1, double t2, int clusterFilter, boolean runSequential) throws IOException, InterruptedException, ClassNotFoundException { return buildClusters(conf, input, output, measure, t1, t2, t1, t2, clusterFilter, runSequential); }
/** * Create a new Canopy containing the given point and canopyId * * @param center a point in vector space * @param canopyId an int identifying the canopy local to this process only * @param measure a DistanceMeasure to use */ public Canopy(Vector center, int canopyId, DistanceMeasure measure) { super(center, canopyId, measure); observe(center); }
/** * Iterate through the canopies, resetting their center to their centroids * * @param canopies * a List<Canopy> */ public static void updateCentroids(Iterable<Canopy> canopies) { for (Canopy canopy : canopies) { canopy.computeParameters(); } }
/** * Convenience method to provide backward compatibility */ public static void run(Configuration conf, Path input, Path output, DistanceMeasure measure, double t1, double t2, boolean runClustering, double clusterClassificationThreshold, boolean runSequential) throws IOException, InterruptedException, ClassNotFoundException { run(conf, input, output, measure, t1, t2, t1, t2, 0, runClustering, clusterClassificationThreshold, runSequential); }
@Override public String getIdentifier() { return "C-" + getId(); } }
/** * Convenience method for backwards compatibility * */ public static Path buildClusters(Configuration conf, Path input, Path output, DistanceMeasure measure, double t1, double t2, int clusterFilter, boolean runSequential) throws IOException, InterruptedException, ClassNotFoundException { return buildClusters(conf, input, output, measure, t1, t2, t1, t2, clusterFilter, runSequential); }
/** * Create a new Canopy containing the given point and canopyId * * @param center a point in vector space * @param canopyId an int identifying the canopy local to this process only * @param measure a DistanceMeasure to use */ public Canopy(Vector center, int canopyId, DistanceMeasure measure) { super(center, canopyId, measure); observe(center); }
/** * Iterate through the canopies, resetting their center to their centroids * * @param canopies * a List<Canopy> */ public static void updateCentroids(Iterable<Canopy> canopies) { for (Canopy canopy : canopies) { canopy.computeParameters(); } }
private void topLevelClustering(Path pointsPath, Configuration conf) throws IOException, InterruptedException, ClassNotFoundException { CanopyDriver.run(conf, pointsPath, outputPath, new ManhattanDistanceMeasure(), 3.1, 2.1, true, 0.0, true); }