org.apache.mahout.classifier.bayes.datastore
Class HBaseBayesDatastore

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

public class HBaseBayesDatastore
extends java.lang.Object
implements Datastore

Class implementing the Datastore for Algorithms to read HBase based model


Constructor Summary
HBaseBayesDatastore(java.lang.String hbaseTable, Parameters params)
           
 
Method Summary
protected  double getAlphaI()
           
protected  double getCachedCell(java.lang.String row, java.lang.String family, java.lang.String column)
           
protected  org.apache.hadoop.hbase.HBaseConfiguration getConfig()
           
protected  java.lang.String getHbaseTable()
           
 java.util.Collection<java.lang.String> getKeys(java.lang.String name)
          get the keySet of a given Matrix/Vector as given by name
protected  Parameters getParameters()
           
protected  org.apache.hadoop.hbase.client.Result getRowFromHbase(java.lang.String feature)
           
protected  double getSigmaJFromHbase(java.lang.String feature)
           
protected  double getSigmaJSigmaK()
           
protected  double getSigmaJSigmaKFromHbase()
           
protected  org.apache.hadoop.hbase.client.HTable getTable()
           
protected  Cache<java.lang.String,org.apache.hadoop.hbase.client.Result> getTableCache()
           
protected  double getThetaNormalizer()
           
protected  double getVocabCount()
           
protected  double getVocabCountFromHbase()
           
 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
protected  double getWeightFromHbase(java.lang.String feature, java.lang.String label)
           
 void initialize()
          Initializes the and loads the model into memory/cache if necessary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HBaseBayesDatastore

public HBaseBayesDatastore(java.lang.String hbaseTable,
                           Parameters params)
Method Detail

getConfig

protected org.apache.hadoop.hbase.HBaseConfiguration getConfig()

getTable

protected org.apache.hadoop.hbase.client.HTable getTable()

getTableCache

protected Cache<java.lang.String,org.apache.hadoop.hbase.client.Result> getTableCache()

getHbaseTable

protected java.lang.String getHbaseTable()

getParameters

protected Parameters getParameters()

getThetaNormalizer

protected double getThetaNormalizer()

getAlphaI

protected double getAlphaI()

getVocabCount

protected double getVocabCount()

getSigmaJSigmaK

protected double getSigmaJSigmaK()

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

getCachedCell

protected double getCachedCell(java.lang.String row,
                               java.lang.String family,
                               java.lang.String column)

getWeightFromHbase

protected double getWeightFromHbase(java.lang.String feature,
                                    java.lang.String label)

getRowFromHbase

protected org.apache.hadoop.hbase.client.Result getRowFromHbase(java.lang.String feature)

getSigmaJFromHbase

protected double getSigmaJFromHbase(java.lang.String feature)

getVocabCountFromHbase

protected double getVocabCountFromHbase()

getSigmaJSigmaKFromHbase

protected double getSigmaJSigmaKFromHbase()


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