[ 
https://issues.apache.org/jira/browse/OPENNLP-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jeff Zemerick closed OPENNLP-1187.
----------------------------------

> Issue in finding accuracy of model
> ----------------------------------
>
>                 Key: OPENNLP-1187
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-1187
>             Project: OpenNLP
>          Issue Type: Bug
>          Components: Doccat, Machine Learning
>    Affects Versions: 1.8.4
>            Reporter: Aman Garg
>            Assignee: Martin Wiesner
>            Priority: Major
>             Fix For: 2.1.1
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> the trainingStats function in NaiveBayesTrainer class is not working properly 
> and display wrong result.
> In findParameters(), at line 154 i.e. 
> EvalParameters evalParams = new EvalParameters(params, numOutcomes);
> should be replaced by following block:
>  
> double[] outcomeTotals = new double[outcomeLabels.length];
>     for (int i = 0; i < params.length; ++i) {
>       Context context = params[i];
>       for (int j = 0; j < context.getOutcomes().length; ++j) {
>         int outcome = context.getOutcomes()[j];
>         double count = context.getParameters()[j];
>         outcomeTotals[outcome] += count;
>       }
>     }
> evalParams = new NaiveBayesEvalParameters(params,
> outcomeLabels.length, outcomeTotals, predLabels.length);



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to