|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.clustering.canopy.CanopyClusterer
public class CanopyClusterer
Constructor Summary | |
---|---|
CanopyClusterer(DistanceMeasure measure,
double t1,
double t2)
|
|
CanopyClusterer(org.apache.hadoop.mapred.JobConf job)
|
Method Summary | |
---|---|
void |
addPointToCanopies(Vector point,
java.util.List<Canopy> canopies,
org.apache.hadoop.mapred.Reporter reporter)
This is the same algorithm as the reference but inverted to iterate over existing canopies instead of the points. |
static java.util.List<Vector> |
calculateCentroids(java.util.List<Canopy> canopies)
Iterate through the canopies, adding their centroids to a list |
boolean |
canopyCovers(Canopy canopy,
Vector point)
Return if the point is covered by the canopy |
void |
config(DistanceMeasure aMeasure,
double aT1,
double aT2)
Configure the Canopy for unit tests |
void |
configure(org.apache.hadoop.mapred.JobConf job)
Configure the Canopy and its distance measure |
static java.util.List<Canopy> |
createCanopies(java.util.List<Vector> points,
DistanceMeasure measure,
double t1,
double t2)
Iterate through the points, adding new canopies. |
void |
emitPointToExistingCanopies(Vector point,
java.util.List<Canopy> canopies,
org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text,VectorWritable> collector,
org.apache.hadoop.mapred.Reporter reporter)
This method is used by the CanopyMapper to perform canopy inclusion tests and to emit the point keyed by its covering canopies to the output. |
void |
emitPointToNewCanopies(Vector point,
java.util.List<Canopy> canopies,
org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text,Vector> collector)
This method is used by the CanopyMapper to perform canopy inclusion tests and to emit the point and its covering canopies to the output. |
static void |
updateCentroids(java.util.List<Canopy> canopies)
Iterate through the canopies, resetting their center to their centroids |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CanopyClusterer(DistanceMeasure measure, double t1, double t2)
public CanopyClusterer(org.apache.hadoop.mapred.JobConf job)
Method Detail |
---|
public void configure(org.apache.hadoop.mapred.JobConf job)
job
- the JobConf for this jobpublic void config(DistanceMeasure aMeasure, double aT1, double aT2)
public void addPointToCanopies(Vector point, java.util.List<Canopy> canopies, org.apache.hadoop.mapred.Reporter reporter)
point
- the point to be addedcanopies
- the Listreporter
- Object to report status to the MR interfacepublic void emitPointToNewCanopies(Vector point, java.util.List<Canopy> canopies, org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text,Vector> collector) throws java.io.IOException
point
- the point to be addedcanopies
- the Listcollector
- an OutputCollector in which to emit the point
java.io.IOException
public void emitPointToExistingCanopies(Vector point, java.util.List<Canopy> canopies, org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text,VectorWritable> collector, org.apache.hadoop.mapred.Reporter reporter) throws java.io.IOException
point
- the point to be addedcanopies
- the Listcollector
- an OutputCollector in which to emit the pointreporter
- to report status of the job
java.io.IOException
public boolean canopyCovers(Canopy canopy, Vector point)
point
- a point
public static java.util.List<Canopy> createCanopies(java.util.List<Vector> points, DistanceMeasure measure, double t1, double t2)
points
- a listmeasure
- a DistanceMeasure to uset1
- the T1 distance thresholdt2
- the T2 distance threshold
public static java.util.List<Vector> calculateCentroids(java.util.List<Canopy> canopies)
canopies
- a Listpublic static void updateCentroids(java.util.List<Canopy> canopies)
canopies
- a List
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |