Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7889459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:06:19+00:00 2026-06-03T06:06:19+00:00

So I’m trying to evaluate the performance of a classifier on a test instance

  • 0

So I’m trying to evaluate the performance of a classifier on a test instance and when I try to get the area under the ROC, the following error is thrown:

Java.lang.NullPointerException
at weka.classifiers.evaluation.ThresholdCurve.getROCArea(ThresholdCurve.java:268)
at weka.classifiers.Evaluation.areaUnderROC(Evaluation.java:382)
at Classifier_Search.runAda(Classifier_Search.java:74)
at Classifier_Search.acrossTest(Classifier_Search.java:142)
at Classifier_Search.main(Classifier_Search.java:511)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at edu.rice.cs.drjava.model.compiler.JavacCompiler.runCommand(JavacCompiler.java:271)

The code that is throwing the error is this:

Evaluation eval = new Evaluation(train);
String[] options = {"-P 100", "-S 1", "-I " + it, "-W weka.classifiers.trees.DecisionStump"};
AdaBoostM1 cls = new AdaBoostM1(); 
cls.setOptions(options);
cls.buildClassifier(train);
eval.evaluateModel(cls, test);
int index = test.classIndex();
return eval.areaUnderROC(index);

When I look up the javadoc for Evaluation (javadoc for Evaluation), It says that areaUnderROC needs to be set by an evaluateClassifier method. No such method exists. Other similar methods (such as falsePositive) work just fine. Has anyone encountered this problem? I can’t find anything on OldNabble (Weka’s help site).

Thanks!

EDIT: to clarify, test and train are both Instances objects that were created with the following code:

private static Instances readFile(File filename) throws IOException
{
CSVLoader loader = new CSVLoader();
loader.setSource(filename);
Instances data = loader.getDataSet();
data.setClassIndex(data.numAttributes() - 1);
return data;
}

They are read from .csv files. Typically if there is something wrong with test or train, the error is thrown here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:06:20+00:00Added an answer on June 3, 2026 at 6:06 am

    Once again, I have the answer to my own question. If someone disagrees with this answer, please let me know. The weka documentation for areaUnderROC, which already has one typo (it references a method, evaluateClassifier, which does not exist), has led me in the wrong direction. I think there is another error in the form of a misleading explanation. areaUnderROC works (without throwing the exception) for two values: 0 and 1. So, rather than taking the class index (the index of the attribute I am using as the class in the Instances object), what it actually wants is which class (of the two classes) to consider as positive. Given the variable names in the documentation, I think it’s reasonable to not understand this at first glance. I also think that since its explanation is in parallel with that of methods that do take the class index (rather than 0 or 1), it is also misleading.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.