org.apache.mahout.classifier.naivebayes
Class NaiveBayesModel
java.lang.Object
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NaiveBayesModel
public NaiveBayesModel(Matrix weightMatrix,
Vector weightsPerFeature,
Vector weightsPerLabel,
Vector thetaNormalizer,
float alphaI)
labelWeight
public double labelWeight(int label)
featureWeight
public double featureWeight(int feature)
weight
public double weight(int label,
int feature)
alphaI
public float alphaI()
numFeatures
public double numFeatures()
totalWeightSum
public double totalWeightSum()
numLabels
public int numLabels()
createScoringVector
public Vector createScoringVector()
materialize
public static NaiveBayesModel materialize(org.apache.hadoop.fs.Path output,
org.apache.hadoop.conf.Configuration conf)
throws IOException
- Throws:
IOException
serialize
public void serialize(org.apache.hadoop.fs.Path output,
org.apache.hadoop.conf.Configuration conf)
throws IOException
- Throws:
IOException
validate
public void validate()
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.