Package opennlp.tools.ml.naivebayes
Class NaiveBayesModel
java.lang.Object
opennlp.tools.ml.model.AbstractModel
opennlp.tools.ml.naivebayes.NaiveBayesModel
- All Implemented Interfaces:
- MaxentModel
A 
MaxentModel implementation of the multinomial Naive Bayes classifier model.- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class opennlp.tools.ml.model.AbstractModelAbstractModel.ModelType
- 
Constructor SummaryConstructorsConstructorDescriptionNaiveBayesModel(Context[] params, String[] predLabels, String[] outcomeNames) Initializes aNaiveBayesModel.
- 
Method SummaryModifier and TypeMethodDescriptionstatic double[]eval(int[] context, double[] prior, EvalParameters model) Evaluates aNaiveBayesModel.double[]Evaluates acontext.double[]Evaluates acontext.double[]Evaluates acontextwith the specified contextvalues.double[]Methods inherited from class opennlp.tools.ml.model.AbstractModelequals, getAllOutcomes, getBestOutcome, getDataStructures, getIndex, getModelType, getNumOutcomes, getOutcome, hashCode
- 
Constructor Details- 
NaiveBayesModelInitializes aNaiveBayesModel.- Parameters:
- params- The- parametersto set.
- predLabels- The predicted labels.
- outcomeNames- The names of the outcomes.
 
 
- 
- 
Method Details- 
evalEvaluates acontext.- Parameters:
- context- An array of String names of the contextual predicates which are to be evaluated together.
- Returns:
- An array of the probabilities for each of the different
         outcomes, all of which sum to 1.
 
- 
evalEvaluates acontextwith the specified contextvalues.- Parameters:
- context- An array of String names of the contextual predicates which are to be evaluated together.
- values- The values associated with each context.
- Returns:
- An array of the probabilities for each of the different
         outcomes, all of which sum to 1.
 
- 
evalEvaluates acontext.- Parameters:
- context- An array of String names of the contextual predicates which are to be evaluated together.
- probs- An array which is populated with the probabilities for each of the different outcomes, all of which sum to 1.
- Returns:
- An array of the probabilities for each of the different
         outcomes, all of which sum to 1.
 
- 
eval
- 
evalEvaluates aNaiveBayesModel.- Parameters:
- context- The context parameters as- int[].
- prior- The data prior to the evaluation as- double[].
- model- The- EvalParametersused for evaluation.
- Returns:
- The resulting evaluation data as double[].
 
 
-