Example usage for org.apache.mahout.classifier.naivebayes StandardNaiveBayesClassifier computeWeight

List of usage examples for org.apache.mahout.classifier.naivebayes StandardNaiveBayesClassifier computeWeight

Introduction

In this page you can find the example usage for org.apache.mahout.classifier.naivebayes StandardNaiveBayesClassifier computeWeight.

Prototype

public static double computeWeight(double featureLabelWeight, double labelWeight, double alphaI,
            double numFeatures) 

Source Link

Usage

From source file:com.netease.news.classifier.naivebayes.StandardThetaTrainer.java

License:Apache License

@Override
public void train(int label, Vector perLabelWeight) {
    double labelWeight = labelWeight(label);
    for (Vector.Element e : perLabelWeight.nonZeroes()) {
        updatePerLabelThetaNormalizer(label,
                StandardNaiveBayesClassifier.computeWeight(e.get(), labelWeight, alphaI(), numFeatures()));
    }/* w w w .ja va 2 s  . c o  m*/
}