org.apache.mahout.classifier.bayes
Class InMemoryBayesDatastore

java.lang.Object
  extended by org.apache.mahout.classifier.bayes.InMemoryBayesDatastore
All Implemented Interfaces:
Datastore

public class InMemoryBayesDatastore
extends Object
implements Datastore

Class implementing the Datastore for Algorithms to read In-Memory model


Constructor Summary
InMemoryBayesDatastore(BayesParameters params)
           
 
Method Summary
 Collection<String> getKeys(String name)
          get the keySet of a given Matrix/Vector as given by name
 double getWeight(String vectorName, String index)
          Gets a double value from the Vector pointed to by the vectorName from its cell pointed to by the index
 double getWeight(String matrixName, String row, String column)
          Gets a double value from the Matrix pointed to by the matrixName from its cell pointed to by the row and column string
 void initialize()
          Initializes the and loads the model into memory/cache if necessary
 void loadFeatureWeight(String feature, String label, double weight)
           
 void setSigmaJSigmaK(double weight)
           
 void setSumFeatureWeight(String feature, double weight)
           
 void setSumLabelWeight(String label, double weight)
           
 void setThetaNormalizer(String label, double weight)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InMemoryBayesDatastore

public InMemoryBayesDatastore(BayesParameters params)
Method Detail

initialize

public void initialize()
                throws InvalidDatastoreException
Description copied from interface: Datastore
Initializes the and loads the model into memory/cache if necessary

Specified by:
initialize in interface Datastore
Throws:
InvalidDatastoreException

getKeys

public Collection<String> getKeys(String name)
                           throws InvalidDatastoreException
Description copied from interface: Datastore
get the keySet of a given Matrix/Vector as given by name

Specified by:
getKeys in interface Datastore
Returns:
Collection of keys of Matrix/Vector
Throws:
InvalidDatastoreException

getWeight

public double getWeight(String matrixName,
                        String row,
                        String column)
                 throws InvalidDatastoreException
Description copied from interface: Datastore
Gets a double value from the Matrix pointed to by the matrixName from its cell pointed to by the row and column string

Specified by:
getWeight in interface Datastore
Returns:
double value
Throws:
InvalidDatastoreException

getWeight

public double getWeight(String vectorName,
                        String index)
                 throws InvalidDatastoreException
Description copied from interface: Datastore
Gets a double value from the Vector pointed to by the vectorName from its cell pointed to by the index

Specified by:
getWeight in interface Datastore
Returns:
double value
Throws:
InvalidDatastoreException

loadFeatureWeight

public void loadFeatureWeight(String feature,
                              String label,
                              double weight)

setSumFeatureWeight

public void setSumFeatureWeight(String feature,
                                double weight)

setSumLabelWeight

public void setSumLabelWeight(String label,
                              double weight)

setThetaNormalizer

public void setThetaNormalizer(String label,
                               double weight)

setSigmaJSigmaK

public void setSigmaJSigmaK(double weight)


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