|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.clustering.dirichlet.models.NormalModel
public class NormalModel
Field Summary |
---|
Fields inherited from interface org.apache.mahout.clustering.Cluster |
---|
CLUSTERED_POINTS_DIR, CLUSTERS_DIR, INITIAL_CLUSTERS_DIR |
Constructor Summary | |
---|---|
NormalModel()
|
|
NormalModel(int id,
Vector mean,
double stdDev)
|
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. |
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 |
Vector |
getCenter()
Get the "center" of the Cluster as a Vector |
int |
getId()
Get the id of the Cluster |
Vector |
getMean()
|
int |
getNumPoints()
Get an integer denoting the number of points observed by this cluster |
Vector |
getRadius()
Get the "radius" of the Cluster as a Vector. |
double |
getStdDev()
|
void |
observe(VectorWritable x)
Observe the given observation, retaining information about it |
double |
pdf(VectorWritable v)
Return the probability that the observation is described by this model |
void |
readFields(java.io.DataInput in)
|
NormalModel |
sampleFromPosterior()
TODO: Return a proper sample from the posterior. |
java.lang.String |
toString()
|
void |
write(java.io.DataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NormalModel()
public NormalModel(int id, Vector mean, double stdDev)
Method Detail |
---|
public Vector getMean()
public double getStdDev()
public NormalModel sampleFromPosterior()
sampleFromPosterior
in interface Model<VectorWritable>
public void observe(VectorWritable x)
Model
observe
in interface Model<VectorWritable>
x
- an Observation from the posteriorpublic void computeParameters()
Model
computeParameters
in interface Model<VectorWritable>
public double pdf(VectorWritable v)
Model
pdf
in interface Model<VectorWritable>
v
- an Observation from the posterior
public int count()
Model
count
in interface Model<VectorWritable>
public java.lang.String toString()
toString
in class java.lang.Object
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 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 asJsonString()
Cluster
asJsonString
in interface Cluster
public Vector getCenter()
Cluster
getCenter
in interface Cluster
public int getId()
Cluster
getId
in interface Cluster
public int getNumPoints()
Cluster
getNumPoints
in interface Cluster
public Vector getRadius()
Cluster
getRadius
in interface Cluster
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |