|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.clustering.ClusterBase
org.apache.mahout.clustering.fuzzykmeans.SoftCluster
public class SoftCluster
Constructor Summary | |
---|---|
SoftCluster()
|
|
SoftCluster(java.lang.String clusterId)
Construct a new softcluster with the given clusterID |
|
SoftCluster(Vector center)
Construct a new SoftCluster with the given point as its center |
|
SoftCluster(Vector center,
int clusterId)
Construct a new SoftCluster with the given point as its center |
Method Summary | |
---|---|
void |
addPoint(Vector point,
double ptProb)
Add the point to the SoftCluster |
void |
addPoints(Vector delta,
double partialSumPtProb)
Add the point to the cluster |
java.lang.String |
asFormatString()
|
Vector |
computeCentroid()
Compute the centroid |
static SoftCluster |
decodeCluster(java.lang.String formattedString)
Decodes and returns a SoftCluster from the formattedString |
static java.lang.String |
formatCluster(SoftCluster cluster)
Format the SoftCluster for output |
java.lang.String |
getIdentifier()
|
double |
getPointProbSum()
|
Vector |
getWeightedPointTotal()
|
boolean |
isConverged()
|
void |
readFields(java.io.DataInput in)
Reads in the id, nothing else |
void |
recomputeCenter()
Compute the centroid and set the center to it. |
void |
setConverged(boolean converged)
|
double |
std()
Compute a "standard deviation" value to use as the "radius" of the cluster for display purposes |
java.lang.String |
toString()
|
void |
write(java.io.DataOutput out)
Simply writes out the id, and that's it! |
Methods inherited from class org.apache.mahout.clustering.ClusterBase |
---|
asFormatString, asJsonString, formatVector, getCenter, getId, getNumPoints, getPointTotal, setCenter, setId, setNumPoints, setPointTotal |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SoftCluster()
public SoftCluster(Vector center)
center
- the center pointpublic SoftCluster(Vector center, int clusterId)
center
- the center pointpublic SoftCluster(java.lang.String clusterId)
Method Detail |
---|
public static java.lang.String formatCluster(SoftCluster cluster)
cluster
- the Clusterpublic static SoftCluster decodeCluster(java.lang.String formattedString)
formattedString
- a String produced by formatClusterpublic void write(java.io.DataOutput out) throws java.io.IOException
ClusterBase
write
in interface org.apache.hadoop.io.Writable
write
in class ClusterBase
out
- The DataOutput
java.io.IOException
public void readFields(java.io.DataInput in) throws java.io.IOException
ClusterBase
readFields
in interface org.apache.hadoop.io.Writable
readFields
in class ClusterBase
java.io.IOException
public Vector computeCentroid()
computeCentroid
in class ClusterBase
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getIdentifier()
getIdentifier
in class ClusterBase
public double std()
public void addPoint(Vector point, double ptProb)
point
- a point to addpublic void addPoints(Vector delta, double partialSumPtProb)
delta
- a point to addpublic double getPointProbSum()
public void recomputeCenter()
public Vector getWeightedPointTotal()
public boolean isConverged()
public void setConverged(boolean converged)
public java.lang.String asFormatString()
asFormatString
in class ClusterBase
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |