org.apache.mahout.clustering.dirichlet
Class DirichletCluster<O>

java.lang.Object
  extended by org.apache.mahout.clustering.dirichlet.DirichletCluster<O>
All Implemented Interfaces:
org.apache.hadoop.io.Writable, Printable

public class DirichletCluster<O>
extends java.lang.Object
implements org.apache.hadoop.io.Writable, Printable


Constructor Summary
DirichletCluster()
           
DirichletCluster(Model<O> model)
           
DirichletCluster(Model<O> model, double totalCount)
           
 
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.
 Model<O> getModel()
           
 double getTotalCount()
           
 void readFields(java.io.DataInput in)
           
static
<O> Model<O>
readModel(java.io.DataInput in)
          Reads a typed Model instance from the input stream
 void setModel(Model<O> model)
           
 void write(java.io.DataOutput out)
           
static void writeModel(java.io.DataOutput out, Model<?> model)
          Writes a typed Model instance to the output stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirichletCluster

public DirichletCluster(Model<O> model,
                        double totalCount)

DirichletCluster

public DirichletCluster(Model<O> model)

DirichletCluster

public DirichletCluster()
Method Detail

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

getModel

public Model<O> getModel()

setModel

public void setModel(Model<O> model)

getTotalCount

public double getTotalCount()

readModel

public static <O> Model<O> readModel(java.io.DataInput in)
                          throws java.io.IOException
Reads a typed Model instance from the input stream

Throws:
java.io.IOException

writeModel

public static void writeModel(java.io.DataOutput out,
                              Model<?> model)
                       throws java.io.IOException
Writes a typed Model instance to the output stream

Throws:
java.io.IOException

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.