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

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

Introduction

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

Prototype

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

Source Link

Usage

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

License:Apache License

@Override
public void train(int label, Vector perLabelWeight) {
    double labelWeight = labelWeight(label);
    for (Vector.Element e : perLabelWeight.nonZeroes()) {
        updatePerLabelThetaNormalizer(label, ComplementaryNaiveBayesClassifier.computeWeight(
                featureWeight(e.index()), e.get(), totalWeightSum(), labelWeight, alphaI(), numFeatures()));
    }//from   w  ww . ja  v  a  2 s.  com
}