|
||||||||||
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(org.apache.hadoop.conf.Configuration config)
|
|
CanopyClusterer(DistanceMeasure measure,
double t1,
double t2)
|
Method Summary | |
---|---|
void |
addPointToCanopies(Vector point,
java.util.Collection<Canopy> canopies)
This is the same algorithm as the reference but inverted to iterate over existing canopies instead of the points. |
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.conf.Configuration configuration)
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 |
emitPointToClosestCanopy(Vector point,
java.lang.Iterable<Canopy> canopies,
org.apache.hadoop.mapreduce.Mapper.Context context)
Emit the point to the closest Canopy |
protected Canopy |
findClosestCanopy(Vector point,
java.lang.Iterable<Canopy> canopies)
|
static java.util.List<Vector> |
getCenters(java.lang.Iterable<Canopy> canopies)
Iterate through the canopies, adding their centroids to a list |
static void |
updateCentroids(java.lang.Iterable<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.conf.Configuration config)
Method Detail |
---|
public void configure(org.apache.hadoop.conf.Configuration configuration)
configuration
- the JobConf for this jobpublic void config(DistanceMeasure aMeasure, double aT1, double aT2)
public void addPointToCanopies(Vector point, java.util.Collection<Canopy> canopies)
point
- the point to be addedcanopies
- the Listpublic void emitPointToClosestCanopy(Vector point, java.lang.Iterable<Canopy> canopies, org.apache.hadoop.mapreduce.Mapper.Context context) throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
protected Canopy findClosestCanopy(Vector point, java.lang.Iterable<Canopy> canopies)
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> getCenters(java.lang.Iterable<Canopy> canopies)
canopies
- a Listpublic static void updateCentroids(java.lang.Iterable<Canopy> canopies)
canopies
- a List
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |