|
||||||||||
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.meanshift.MeanShiftCanopy
public class MeanShiftCanopy
This class models a canopy as a center point, the number of points that are contained within it according to the application of some distance metric, and a point total which is the sum of all the points and is used to compute the centroid when needed.
Constructor Summary | |
---|---|
MeanShiftCanopy()
|
|
MeanShiftCanopy(Vector point,
int id)
Create a new Canopy containing the given point |
Method Summary | |
---|---|
java.lang.String |
asFormatString()
|
Vector |
computeCentroid()
Compute the centroid by normalizing the pointTotal |
static MeanShiftCanopy |
decodeCanopy(java.lang.String formattedString)
Decodes and returns a Canopy from the formattedString |
static java.lang.String |
formatCanopy(MeanShiftCanopy canopy)
Format the canopy for output |
IntArrayList |
getBoundPoints()
|
int |
getCanopyId()
|
java.lang.String |
getIdentifier()
|
boolean |
isConverged()
|
void |
readFields(java.io.DataInput in)
Reads in the id, nothing else |
void |
setBoundPoints(IntArrayList boundPoints)
|
void |
setConverged(boolean converged)
|
MeanShiftCanopy |
shallowCopy()
|
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 MeanShiftCanopy()
public MeanShiftCanopy(Vector point, int id)
point
- a VectorMethod Detail |
---|
public Vector computeCentroid()
computeCentroid
in class ClusterBase
public IntArrayList getBoundPoints()
public int getCanopyId()
public java.lang.String getIdentifier()
getIdentifier
in class ClusterBase
public boolean isConverged()
public java.lang.String toString()
toString
in class java.lang.Object
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 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 MeanShiftCanopy shallowCopy()
public java.lang.String asFormatString()
asFormatString
in class ClusterBase
public void setBoundPoints(IntArrayList boundPoints)
public void setConverged(boolean converged)
public static java.lang.String formatCanopy(MeanShiftCanopy canopy)
public static MeanShiftCanopy decodeCanopy(java.lang.String formattedString)
formattedString
- a String produced by formatCanopy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |