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

Issue in finding accuracy of model

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.4
    • 2.1.1
    • Doccat, Machine Learning
    • None
    • 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

            mawiesne Martin Wiesner
            agarg98 Aman Garg
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

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