|
||||||||||
| 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)
|
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 |
getNumObservations()
Return the number of observations that this model has seen since its parameters were last computed |
Collection<Parameter<?>> |
getParameters()
|
Vector |
getRadius()
Get the "radius" of the Cluster as a Vector. |
protected double |
getS0()
|
protected Vector |
getS1()
|
protected Vector |
getS2()
|
long |
getTotalObservations()
Return the number of observations that this model has seen over its lifetime |
boolean |
isConverged()
|
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 |
setNumObservations(long l)
|
protected void |
setRadius(Vector radius)
|
protected void |
setS0(double s0)
|
protected void |
setS1(Vector s1)
|
protected void |
setS2(Vector s2)
|
protected void |
setTotalObservations(long totalPoints)
|
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 write(DataOutput out)
throws IOException
write in interface org.apache.hadoop.io.WritableIOException
public void readFields(DataInput in)
throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionpublic void configure(org.apache.hadoop.conf.Configuration job)
configure in interface Parameteredpublic Collection<Parameter<?>> getParameters()
getParameters in interface Parametered
public void createParameters(String prefix,
org.apache.hadoop.conf.Configuration jobConf)
ParameteredParametered.ParameteredGeneralizations if java supported it. Calling this method should create a new list of
parameters and is called
createParameters in interface Parameteredprefix - ends with a dot if not empty.jobConf - configuration used for retrieving valuesinvoking method,
invoking methodpublic int getId()
Cluster
getId in interface Clusterprotected void setId(int id)
id - the id to setpublic long getNumObservations()
Model
getNumObservations in interface Model<VectorWritable>protected void setNumObservations(long l)
l - the numPoints to setpublic long getTotalObservations()
Model
getTotalObservations in interface Model<VectorWritable>protected void setTotalObservations(long totalPoints)
public Vector getCenter()
Cluster
getCenter in interface Clusterprotected void setCenter(Vector center)
center - the center to setpublic Vector getRadius()
Cluster
getRadius in interface Clusterprotected void setRadius(Vector radius)
radius - the radius to setprotected double getS0()
protected void setS0(double s0)
protected Vector getS1()
protected void setS1(Vector s1)
protected Vector getS2()
protected void setS2(Vector s2)
public void observe(Model<VectorWritable> x)
Model
observe in interface Model<VectorWritable>x - a Model<0>public void observe(VectorWritable x)
Model
observe in interface Model<VectorWritable>x - an Observation from the posterior
public void observe(VectorWritable x,
double weight)
Model
observe in interface Model<VectorWritable>x - an Observation from the posteriorweight - a double weighting factor
public void observe(Vector x,
double weight)
public void observe(Vector x)
public void computeParameters()
Model
computeParameters in interface Model<VectorWritable>public String asFormatString(String[] bindings)
Cluster
asFormatString in interface Clusterbindings - an optional String[] containing labels used to format the primary
Vector/s of this implementation.
public abstract String getIdentifier()
public Vector computeCentroid()
public static String formatVector(Vector v,
String[] bindings)
public boolean isConverged()
isConverged in interface Cluster
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||