|
||||||||||
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(DistanceMeasure measure,
double convergenceDelta,
double m)
Init the fuzzy k-means clusterer with the distance measure to use for comparison. |
|
FuzzyKMeansClusterer(org.apache.hadoop.mapred.JobConf job)
|
Method Summary | |
---|---|
static java.util.List<java.util.List<SoftCluster>> |
clusterPoints(java.util.List<Vector> points,
java.util.List<SoftCluster> clusters,
DistanceMeasure measure,
double threshold,
double m,
int numIter)
This is the reference k-means implementation. |
boolean |
computeConvergence(SoftCluster cluster)
Return if the cluster is converged by comparing its center and centroid. |
double |
computeProbWeight(double clusterDistance,
java.util.List<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.mapred.OutputCollector<org.apache.hadoop.io.Text,FuzzyKMeansInfo> output)
Emit the point and its probability of belongingness to each cluster |
double |
getM()
|
DistanceMeasure |
getMeasure()
|
void |
outputPointWithClusterProbabilities(java.lang.String key,
Vector point,
java.util.List<SoftCluster> clusters,
org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text,FuzzyKMeansOutput> output)
Output point with cluster info (Cluster and probability) |
static boolean |
runFuzzyKMeansIteration(java.util.List<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. |
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)
measure
- The distance measure to use for comparing clusters against points.convergenceDelta
- When do we define a cluster to have converged?public FuzzyKMeansClusterer(org.apache.hadoop.mapred.JobConf job)
Method Detail |
---|
public void emitPointProbToCluster(Vector point, java.util.List<SoftCluster> clusters, org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text,FuzzyKMeansInfo> output) throws java.io.IOException
point
- a pointclusters
- a Listoutput
- the OutputCollector to emit into
java.io.IOException
public void outputPointWithClusterProbabilities(java.lang.String key, Vector point, java.util.List<SoftCluster> clusters, org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text,FuzzyKMeansOutput> output) throws java.io.IOException
point
- a pointclusters
- a Listoutput
- the OutputCollector to emit into
java.io.IOException
public double computeProbWeight(double clusterDistance, java.util.List<java.lang.Double> clusterDistanceList)
public boolean computeConvergence(SoftCluster cluster)
public double getM()
public DistanceMeasure getMeasure()
public static java.util.List<java.util.List<SoftCluster>> clusterPoints(java.util.List<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 usenumIter
- the maximum number of iterationspublic static boolean runFuzzyKMeansIteration(java.util.List<Vector> points, java.util.List<SoftCluster> clusterList, FuzzyKMeansClusterer clusterer)
points
- the ListclusterList
- the List
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |