## org.apache.mahout.classifier.bayes.datastore
Class InMemoryBayesDatastore

    java.lang.Object
      org.apache.mahout.classifier.bayes.datastore.InMemoryBayesDatastore

All Implemented Interfaces:
  Datastore

    public class InMemoryBayesDatastore

extends java.lang.Object
implements Datastore

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

Constructor Summary
`InMemoryBayesDatastore(Parameters params)`

Method Summary
`java.util.Collection<java.lang.String>` `getKeys(java.lang.String name)` get the keySet of a given Matrix/Vector as given by `name`
`double` `getWeight(java.lang.String vectorName, java.lang.String index)` Gets a double value from the Vector pointed to by the `vectorName` from its cell pointed to by the `index`
`double` `getWeight(java.lang.String matrixName, java.lang.String row, java.lang.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(java.lang.String feature, java.lang.String label, double weight)`
`void` `setSigmaJSigmaK(double weight)`
`void` `setSumFeatureWeight(java.lang.String feature, double weight)`
`void` `setSumLabelWeight(java.lang.String label, double weight)`
`void` `setThetaNormalizer(java.lang.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(Parameters 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 java.util.Collection<java.lang.String> getKeys(java.lang.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(java.lang.String matrixName,
                            java.lang.String row,
                            java.lang.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(java.lang.String vectorName,
                            java.lang.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(java.lang.String feature,
                                  java.lang.String label,
                                  double weight)

### setSumFeatureWeight

    public void setSumFeatureWeight(java.lang.String feature,
                                    double weight)

### setSumLabelWeight

    public void setSumLabelWeight(java.lang.String label,
                                  double weight)

### setThetaNormalizer

    public void setThetaNormalizer(java.lang.String label,
                                   double weight)

### setSigmaJSigmaK

    public void setSigmaJSigmaK(double weight)

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