List of usage examples for org.apache.mahout.classifier.naivebayes ComplementaryNaiveBayesClassifier computeWeight
public static double computeWeight(double featureWeight, double featureLabelWeight, double totalWeight, double labelWeight, double alphaI, double numFeatures)
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 }