org.apache.mahout.clustering.dirichlet.models
Class L1Model

java.lang.Object
  extended by org.apache.mahout.clustering.dirichlet.models.L1Model
All Implemented Interfaces:
org.apache.hadoop.io.Writable, Model<VectorWritable>, Printable

public class L1Model
extends java.lang.Object
implements Model<VectorWritable>


Constructor Summary
L1Model()
           
L1Model(Vector v)
           
 
Method Summary
 java.lang.String asFormatString(java.lang.String[] bindings)
          Produce a custom, printable representation of the receiver.
 java.lang.String asJsonString()
          Produce a printable representation of the receiver using Json.
 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
 void observe(VectorWritable x)
          Observe the given observation, retaining information about it
 double pdf(VectorWritable x)
          Return the probability that the observation is described by this model
 void readFields(java.io.DataInput in)
           
 L1Model sample()
           
 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

L1Model

public L1Model()

L1Model

public L1Model(Vector v)
Method Detail

computeParameters

public void computeParameters()
Description copied from interface: Model
Compute a new set of posterior parameters based upon the Observations that have been observed since my creation

Specified by:
computeParameters in interface Model<VectorWritable>

count

public int count()
Description copied from interface: Model
Return the number of observations that have been observed by this model

Specified by:
count in interface Model<VectorWritable>
Returns:
an int

observe

public void observe(VectorWritable x)
Description copied from interface: Model
Observe the given observation, retaining information about it

Specified by:
observe in interface Model<VectorWritable>
Parameters:
x - an Observation from the posterior

pdf

public double pdf(VectorWritable x)
Description copied from interface: Model
Return the probability that the observation is described by this model

Specified by:
pdf in interface Model<VectorWritable>
Parameters:
x - an Observation from the posterior
Returns:
the probability that x is in the receiver

readFields

public void readFields(java.io.DataInput in)
                throws java.io.IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException

sample

public L1Model sample()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

asFormatString

public java.lang.String asFormatString(java.lang.String[] bindings)
Description copied from interface: Printable
Produce a custom, printable representation of the receiver.

Specified by:
asFormatString in interface Printable
Parameters:
bindings - an optional String[] containing labels used to format the primary Vector/s of this implementation.
Returns:
a String

asJsonString

public java.lang.String asJsonString()
Description copied from interface: Printable
Produce a printable representation of the receiver using Json. (Label bindings are transient and not part of the Json representation)

Specified by:
asJsonString in interface Printable
Returns:
a Json String


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.