|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.clustering.fuzzykmeans.FuzzyKMeansClusterer
public class FuzzyKMeansClusterer
Constructor Summary | |
---|---|
FuzzyKMeansClusterer()
|
|
FuzzyKMeansClusterer(org.apache.hadoop.conf.Configuration conf)
|
|
FuzzyKMeansClusterer(DistanceMeasure measure,
double convergenceDelta,
double m)
Init the fuzzy k-means clusterer with the distance measure to use for comparison. |
Method Summary | |
---|---|
protected void |
addPointToClusters(java.util.List<SoftCluster> clusterList,
Vector point)
|
static java.util.List<java.util.List<SoftCluster>> |
clusterPoints(java.lang.Iterable<Vector> points,
java.util.List<SoftCluster> clusters,
DistanceMeasure measure,
double threshold,
double m,
int numIter)
This is the reference k-means implementation. |
boolean |
computeConvergence(Cluster cluster)
Return if the cluster is converged by comparing its center and centroid. |
Vector |
computePi(java.util.List<SoftCluster> clusters,
java.util.List<java.lang.Double> clusterDistanceList)
|
double |
computeProbWeight(double clusterDistance,
java.lang.Iterable<java.lang.Double> clusterDistanceList)
Computes the probability of a point belonging to a cluster |
void |
emitPointProbToCluster(Vector point,
java.util.List<SoftCluster> clusters,
org.apache.hadoop.mapreduce.Mapper.Context context)
Emit the point and its probability of belongingness to each cluster |
void |
emitPointToClusters(VectorWritable point,
java.util.List<SoftCluster> clusters,
org.apache.hadoop.mapreduce.Mapper.Context context)
|
void |
emitPointToClusters(VectorWritable point,
java.util.List<SoftCluster> clusters,
org.apache.hadoop.io.SequenceFile.Writer writer)
|
double |
getM()
|
DistanceMeasure |
getMeasure()
|
protected static boolean |
runFuzzyKMeansIteration(java.lang.Iterable<Vector> points,
java.util.List<SoftCluster> clusterList,
FuzzyKMeansClusterer clusterer)
Perform a single iteration over the points and clusters, assigning points to clusters and returning if the iterations are completed. |
protected boolean |
testConvergence(java.lang.Iterable<SoftCluster> clusters)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FuzzyKMeansClusterer(DistanceMeasure measure, double convergenceDelta, double m)
public FuzzyKMeansClusterer(org.apache.hadoop.conf.Configuration conf)
public FuzzyKMeansClusterer()
Method Detail |
---|
public static java.util.List<java.util.List<SoftCluster>> clusterPoints(java.lang.Iterable<Vector> points, java.util.List<SoftCluster> clusters, DistanceMeasure measure, double threshold, double m, int numIter)
points
- the input Listclusters
- the initial Listmeasure
- the DistanceMeasure to usethreshold
- the double convergence thresholdm
- the double "fuzzyness" argument (>1)numIter
- the maximum number of iterations
protected static boolean runFuzzyKMeansIteration(java.lang.Iterable<Vector> points, java.util.List<SoftCluster> clusterList, FuzzyKMeansClusterer clusterer)
points
- the ListclusterList
- the Listpublic void emitPointProbToCluster(Vector point, java.util.List<SoftCluster> clusters, org.apache.hadoop.mapreduce.Mapper.Context context) throws java.io.IOException, java.lang.InterruptedException
point
- a pointclusters
- a Listcontext
- the Context to emit into
java.io.IOException
java.lang.InterruptedException
public double computeProbWeight(double clusterDistance, java.lang.Iterable<java.lang.Double> clusterDistanceList)
public boolean computeConvergence(Cluster cluster)
public double getM()
public DistanceMeasure getMeasure()
public void emitPointToClusters(VectorWritable point, java.util.List<SoftCluster> clusters, org.apache.hadoop.mapreduce.Mapper.Context context) throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
public Vector computePi(java.util.List<SoftCluster> clusters, java.util.List<java.lang.Double> clusterDistanceList)
protected void addPointToClusters(java.util.List<SoftCluster> clusterList, Vector point)
protected boolean testConvergence(java.lang.Iterable<SoftCluster> clusters)
public void emitPointToClusters(VectorWritable point, java.util.List<SoftCluster> clusters, org.apache.hadoop.io.SequenceFile.Writer writer) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |