org.apache.mahout.classifier.naivebayes
Class NaiveBayesModel

java.lang.Object
  extended by org.apache.mahout.classifier.naivebayes.NaiveBayesModel

public class NaiveBayesModel
extends Object

NaiveBayesModel holds the weight Matrix, the feature and label sums and the weight normalizer vectors.


Constructor Summary
NaiveBayesModel(Matrix matrix, Vector featureSum, Vector labelSum, Vector thetaNormalizer, float alphaI)
           
 
Method Summary
static NaiveBayesModel fromMRTrainerOutput(org.apache.hadoop.fs.Path output, org.apache.hadoop.conf.Configuration conf)
           
 float getAlphaI()
           
 Vector getFeatureSum()
           
 Vector getLabelSum()
           
static String getModelName()
           
 int getNumLabels()
           
 Vector getPerlabelThetaNormalizer()
           
 double getTotalSum()
           
 double getVocabCount()
           
 Matrix getWeightMatrix()
           
 void setAlphaI(float alphaI)
           
 void setFeatureSum(Vector featureSum)
           
 void setPerlabelThetaNormalizer(Vector perlabelThetaNormalizer)
           
 void setTotalSum(double totalSum)
           
 void setVocabCount(double vocabCount)
           
 void setWeightMatrix(Matrix weightMatrix)
           
static void validate(NaiveBayesModel model)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NaiveBayesModel

public NaiveBayesModel(Matrix matrix,
                       Vector featureSum,
                       Vector labelSum,
                       Vector thetaNormalizer,
                       float alphaI)
Method Detail

setPerlabelThetaNormalizer

public void setPerlabelThetaNormalizer(Vector perlabelThetaNormalizer)

setFeatureSum

public void setFeatureSum(Vector featureSum)

setWeightMatrix

public void setWeightMatrix(Matrix weightMatrix)

setAlphaI

public void setAlphaI(float alphaI)

setVocabCount

public void setVocabCount(double vocabCount)

setTotalSum

public void setTotalSum(double totalSum)

getLabelSum

public Vector getLabelSum()

getPerlabelThetaNormalizer

public Vector getPerlabelThetaNormalizer()

getFeatureSum

public Vector getFeatureSum()

getWeightMatrix

public Matrix getWeightMatrix()

getAlphaI

public float getAlphaI()

getVocabCount

public double getVocabCount()

getTotalSum

public double getTotalSum()

getNumLabels

public int getNumLabels()

getModelName

public static String getModelName()

fromMRTrainerOutput

public static NaiveBayesModel fromMRTrainerOutput(org.apache.hadoop.fs.Path output,
                                                  org.apache.hadoop.conf.Configuration conf)

validate

public static void validate(NaiveBayesModel model)


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