|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.clustering.AbstractCluster
public abstract class AbstractCluster
Field Summary |
---|
Fields inherited from interface org.apache.mahout.clustering.Cluster |
---|
CLUSTERED_POINTS_DIR, CLUSTERS_DIR, INITIAL_CLUSTERS_DIR |
Constructor Summary | |
---|---|
protected |
AbstractCluster()
|
protected |
AbstractCluster(Vector point,
int id2)
|
protected |
AbstractCluster(Vector center2,
Vector radius2,
int id2)
|
Method Summary | |
---|---|
java.lang.String |
asFormatString(java.lang.String[] bindings)
Produce a custom, human-friendly, printable representation of the Cluster. |
java.lang.String |
asJsonString()
Produce a textual representation of the Cluster using Json format. |
Vector |
computeCentroid()
Compute the centroid by averaging the pointTotals |
void |
computeParameters()
Compute a new set of posterior parameters based upon the Observations that have been observed since my creation |
int |
count()
Return the number of observations that have been observed by this model |
static java.lang.String |
formatVector(Vector v,
java.lang.String[] bindings)
Return a human-readable formatted string representation of the vector, not intended to be complete nor usable as an input/output representation such as Json |
Vector |
getCenter()
Get the "center" of the Cluster as a Vector |
int |
getId()
Get the id of the Cluster |
abstract java.lang.String |
getIdentifier()
|
int |
getNumPoints()
Get an integer denoting the number of points observed by this cluster |
ClusterObservations |
getObservations()
|
Vector |
getRadius()
Get the "radius" of the Cluster as a Vector. |
protected double |
getS0()
|
protected Vector |
getS1()
|
protected Vector |
getS2()
|
void |
observe(ClusterObservations observations)
|
void |
observe(Vector x)
|
void |
observe(Vector x,
double weight)
|
void |
observe(VectorWritable x)
Observe the given observation, retaining information about it |
void |
readFields(java.io.DataInput in)
|
protected void |
setCenter(Vector center)
|
protected void |
setId(int id)
|
protected void |
setNumPoints(int numPoints)
|
protected void |
setRadius(Vector radius)
|
void |
write(java.io.DataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.mahout.clustering.Model |
---|
pdf, sampleFromPosterior |
Constructor Detail |
---|
protected AbstractCluster()
protected AbstractCluster(Vector point, int id2)
protected AbstractCluster(Vector center2, Vector radius2, int id2)
Method Detail |
---|
protected void setId(int id)
id
- the id to setprotected void setNumPoints(int numPoints)
numPoints
- the numPoints to setprotected void setCenter(Vector center)
center
- the center to setprotected void setRadius(Vector radius)
radius
- the radius to setprotected double getS0()
protected Vector getS1()
protected Vector getS2()
public void observe(ClusterObservations observations)
public void observe(VectorWritable x)
Model
observe
in interface Model<VectorWritable>
x
- an Observation from the posteriorpublic void observe(Vector x, double weight)
public void observe(Vector x)
public int getNumPoints()
Cluster
getNumPoints
in interface Cluster
public ClusterObservations getObservations()
public void computeParameters()
Model
computeParameters
in interface Model<VectorWritable>
public void readFields(java.io.DataInput in) throws java.io.IOException
readFields
in interface org.apache.hadoop.io.Writable
java.io.IOException
public void write(java.io.DataOutput out) throws java.io.IOException
write
in interface org.apache.hadoop.io.Writable
java.io.IOException
public java.lang.String asFormatString(java.lang.String[] bindings)
Cluster
asFormatString
in interface Cluster
bindings
- an optional String[] containing labels used to format the primary Vector/s of this
implementation.
public abstract java.lang.String getIdentifier()
public java.lang.String asJsonString()
Cluster
asJsonString
in interface Cluster
public Vector getCenter()
Cluster
getCenter
in interface Cluster
public int getId()
Cluster
getId
in interface Cluster
public Vector getRadius()
Cluster
getRadius
in interface Cluster
public Vector computeCentroid()
public static java.lang.String formatVector(Vector v, java.lang.String[] bindings)
v
- a Vector
public int count()
Model
count
in interface Model<VectorWritable>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |