You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@opennlp.apache.org by "Jeff Zemerick (JIRA)" <ji...@apache.org> on 2018/04/03 22:15:00 UTC

[jira] [Commented] (OPENNLP-1187) Issue in finding accuracy of model

    [ https://issues.apache.org/jira/browse/OPENNLP-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16424687#comment-16424687 ] 

Jeff Zemerick commented on OPENNLP-1187:
----------------------------------------

[~agarg98] Thanks for the report. Would you consider submitting this as a pull request on GitHub at https://github.com/apache/opennlp?

> 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
>            Priority: Major
>   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
(v7.6.3#76005)