public abstract class AbstractNaiveBayesClassifier extends AbstractVectorClassifier
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractNaiveBayesClassifier(NaiveBayesModel model) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.mahout.math.Vector |
classify(org.apache.mahout.math.Vector instance)
Classify a vector returning a vector of numCategories-1 scores.
|
org.apache.mahout.math.Vector |
classifyFull(org.apache.mahout.math.Vector instance)
Returns n probabilities, one for each category.
|
org.apache.mahout.math.Vector |
classifyFull(org.apache.mahout.math.Vector r,
org.apache.mahout.math.Vector instance)
Returns n probabilities, one for each category into a pre-allocated vector.
|
double |
classifyScalar(org.apache.mahout.math.Vector instance)
Classifies a vector in the special case of a binary classifier where
AbstractVectorClassifier.classify(Vector) would return a vector with only one element. |
protected NaiveBayesModel |
getModel() |
protected abstract double |
getScoreForLabelFeature(int label,
int feature) |
protected double |
getScoreForLabelInstance(int label,
org.apache.mahout.math.Vector instance) |
int |
numCategories()
Returns the number of categories for the target variable.
|
classify, classifyFull, classifyNoLink, classifyScalar, logLikelihoodprotected AbstractNaiveBayesClassifier(NaiveBayesModel model)
protected NaiveBayesModel getModel()
protected abstract double getScoreForLabelFeature(int label,
int feature)
protected double getScoreForLabelInstance(int label,
org.apache.mahout.math.Vector instance)
public int numCategories()
AbstractVectorClassifiernumCategories in class AbstractVectorClassifierpublic org.apache.mahout.math.Vector classifyFull(org.apache.mahout.math.Vector instance)
AbstractVectorClassifierclassifyFull in class AbstractVectorClassifierinstance - A vector of features to be classified.AbstractVectorClassifier.classify(Vector),
AbstractVectorClassifier.classifyFull(Vector r, Vector instance)public org.apache.mahout.math.Vector classifyFull(org.apache.mahout.math.Vector r,
org.apache.mahout.math.Vector instance)
AbstractVectorClassifierclassifyFull in class AbstractVectorClassifierr - Where to put the results.instance - A vector of features to be classified.public double classifyScalar(org.apache.mahout.math.Vector instance)
AbstractVectorClassifierAbstractVectorClassifier.classify(Vector) would return a vector with only one element. As such,
using this method can void the allocation of a vector.classifyScalar in class AbstractVectorClassifierinstance - The feature vector to be classified.AbstractVectorClassifier.classify(Vector)public org.apache.mahout.math.Vector classify(org.apache.mahout.math.Vector instance)
AbstractVectorClassifierclassify in class AbstractVectorClassifierinstance - A feature vector to be classified.Copyright © 2008-2013 The Apache Software Foundation. All Rights Reserved.