/** * 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(); } }
/** * 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(); } }
/** * 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 cleanup(Context context) throws IOException, InterruptedException { for (Canopy canopy : canopies) { canopy.computeParameters(); if (canopy.getNumObservations() > clusterFilter) { context.write(new Text("centroid"), new VectorWritable(canopy .getCenter())); } } super.cleanup(context); } }
@Override protected void cleanup(Context context) throws IOException, InterruptedException { for (Canopy canopy : canopies) { canopy.computeParameters(); if (canopy.getNumObservations() > clusterFilter) { context.write(new Text("centroid"), new VectorWritable(canopy .getCenter())); } } super.cleanup(context); } }
@Override protected void cleanup(Context context) throws IOException, InterruptedException { for (Canopy canopy : canopies) { canopy.computeParameters(); if (canopy.getNumObservations() > clusterFilter) { context.write(new Text("centroid"), new VectorWritable(canopy .getCenter())); } } super.cleanup(context); } }
@Override protected void reduce(Text arg0, Iterable<VectorWritable> values, Context context) throws IOException, InterruptedException { for (VectorWritable value : values) { Vector point = value.get(); canopyClusterer.addPointToCanopies(point, canopies); } for (Canopy canopy : canopies) { canopy.computeParameters(); if (canopy.getNumObservations() > clusterFilter) { ClusterWritable clusterWritable = new ClusterWritable(); clusterWritable.setValue(canopy); context.write(new Text(canopy.getIdentifier()), clusterWritable); } } }
@Override protected void reduce(Text arg0, Iterable<VectorWritable> values, Context context) throws IOException, InterruptedException { for (VectorWritable value : values) { Vector point = value.get(); canopyClusterer.addPointToCanopies(point, canopies); } for (Canopy canopy : canopies) { canopy.computeParameters(); if (canopy.getNumObservations() > clusterFilter) { ClusterWritable clusterWritable = new ClusterWritable(); clusterWritable.setValue(canopy); context.write(new Text(canopy.getIdentifier()), clusterWritable); } } }
@Override protected void reduce(Text arg0, Iterable<VectorWritable> values, Context context) throws IOException, InterruptedException { for (VectorWritable value : values) { Vector point = value.get(); canopyClusterer.addPointToCanopies(point, canopies); } for (Canopy canopy : canopies) { canopy.computeParameters(); if (canopy.getNumObservations() > clusterFilter) { ClusterWritable clusterWritable = new ClusterWritable(); clusterWritable.setValue(canopy); context.write(new Text(canopy.getIdentifier()), clusterWritable); } } }
ClusterWritable clusterWritable = new ClusterWritable(); for (Canopy canopy : canopies) { canopy.computeParameters(); if (log.isDebugEnabled()) { log.debug("Writing Canopy:{} center:{} numPoints:{} radius:{}",
ClusterWritable clusterWritable = new ClusterWritable(); for (Canopy canopy : canopies) { canopy.computeParameters(); if (log.isDebugEnabled()) { log.debug("Writing Canopy:{} center:{} numPoints:{} radius:{}",
ClusterWritable clusterWritable = new ClusterWritable(); for (Canopy canopy : canopies) { canopy.computeParameters(); if (log.isDebugEnabled()) { log.debug("Writing Canopy:{} center:{} numPoints:{} radius:{}",