|
||||||||||
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
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.mahout.common.parameters.Parametered |
---|
Parametered.ParameteredGeneralizations |
Field Summary |
---|
Fields inherited from interface org.apache.mahout.clustering.Cluster |
---|
CLUSTERED_POINTS_DIR, CLUSTERS_DIR, FINAL_ITERATION_SUFFIX, INITIAL_CLUSTERS_DIR |
Fields inherited from interface org.apache.mahout.common.parameters.Parametered |
---|
log |
Constructor Summary | |
---|---|
protected |
AbstractCluster()
|
protected |
AbstractCluster(Vector point,
int id2)
|
protected |
AbstractCluster(Vector center2,
Vector radius2,
int id2)
|
Method Summary | |
---|---|
String |
asFormatString(String[] bindings)
Produce a custom, human-friendly, printable representation of the Cluster. |
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 |
void |
configure(org.apache.hadoop.conf.Configuration job)
|
long |
count()
Return the number of observations that have been observed by this model |
void |
createParameters(String prefix,
org.apache.hadoop.conf.Configuration jobConf)
EXPERT: consumers should never have to call this method. |
static String |
formatVector(Vector v,
String[] bindings)
Return a human-readable formatted string representation of the vector, not intended to be complete nor usable as an input/output representation |
Vector |
getCenter()
Get the "center" of the Cluster as a Vector |
int |
getId()
Get the id of the Cluster |
abstract String |
getIdentifier()
|
long |
getNumPoints()
Get an integer denoting the number of points observed by this cluster |
ClusterObservations |
getObservations()
|
Collection<Parameter<?>> |
getParameters()
|
Vector |
getRadius()
Get the "radius" of the Cluster as a Vector. |
protected double |
getS0()
|
protected Vector |
getS1()
|
protected Vector |
getS2()
|
boolean |
isConverged()
|
void |
observe(ClusterObservations observations)
|
void |
observe(Model<VectorWritable> x)
Observe the given model, retaining information about its observations |
void |
observe(Vector x)
|
void |
observe(Vector x,
double weight)
|
void |
observe(VectorWritable x)
Observe the given observation, retaining information about it |
void |
observe(VectorWritable x,
double weight)
Observe the given observation, retaining information about it |
void |
readFields(DataInput in)
|
protected void |
setCenter(Vector center)
|
protected void |
setId(int id)
|
protected void |
setNumPoints(long l)
|
protected void |
setRadius(Vector radius)
|
protected void |
setS0(double s0)
|
protected void |
setS1(Vector s1)
|
protected void |
setS2(Vector s2)
|
void |
write(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 |
---|
public void configure(org.apache.hadoop.conf.Configuration job)
configure
in interface Parametered
public Collection<Parameter<?>> getParameters()
getParameters
in interface Parametered
public void createParameters(String prefix, org.apache.hadoop.conf.Configuration jobConf)
Parametered
Parametered.ParameteredGeneralizations
if java supported it. Calling this method should create a new list of
parameters and is called
createParameters
in interface Parametered
prefix
- ends with a dot if not empty.jobConf
- configuration used for retrieving valuesinvoking method
,
invoking method
protected void setId(int id)
id
- the id to setprotected void setNumPoints(long l)
l
- 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(Model<VectorWritable> x)
Model
observe
in interface Model<VectorWritable>
x
- a Model<0>public void observe(ClusterObservations observations)
public void observe(VectorWritable x)
Model
observe
in interface Model<VectorWritable>
x
- an Observation from the posteriorpublic void observe(VectorWritable x, double weight)
Model
observe
in interface Model<VectorWritable>
x
- an Observation from the posteriorweight
- a double weighting factorpublic void observe(Vector x, double weight)
public void observe(Vector x)
public long getNumPoints()
Cluster
getNumPoints
in interface Cluster
public ClusterObservations getObservations()
public void computeParameters()
Model
computeParameters
in interface Model<VectorWritable>
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public String asFormatString(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 String getIdentifier()
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 String formatVector(Vector v, String[] bindings)
public long count()
Model
count
in interface Model<VectorWritable>
public boolean isConverged()
isConverged
in interface Cluster
protected void setS0(double s0)
protected void setS1(Vector s1)
protected void setS2(Vector s2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |