Uploaded image for project: 'OpenNLP'
  1. OpenNLP
  2. OPENNLP-1187

Issue in finding accuracy of model

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.8.4
    • Fix Version/s: None
    • Component/s: Doccat, Machine Learning
    • Labels:
      None
    • Flags:
      Important

      Description

      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);

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              agarg98 Aman Garg
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 48h
                48h
                Remaining:
                Remaining Estimate - 48h
                48h
                Logged:
                Time Spent - Not Specified
                Not Specified