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 8941659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:21:23+00:00 2026-06-15T11:21:23+00:00

I am following the code example as below: RandomUtils.useTestSeed(); DataModel model = new FileDataModel(new

  • 0

I am following the code example as below:

    RandomUtils.useTestSeed();
    DataModel model = new FileDataModel(new File(file));
    RecommenderIRStatsEvaluator evaluator = new GenericRecommenderIRStatsEvaluator();
    RecommenderBuilder recommenderBuilder = new RecommenderBuilder() {
        public Recommender buildRecommender(DataModel model)
                throws TasteException {
            UserSimilarity similarity = new PearsonCorrelationSimilarity(
                    model);
            UserNeighborhood neighborhood = new NearestNUserNeighborhood(2,
                    similarity, model);
            return new GenericUserBasedRecommender(model, neighborhood,
                    similarity);
        }
    };
    IRStatistics stats = evaluator.evaluate(recommenderBuilder, null,
            model, null, 4, 4, 0.5);
    System.out.println(stats.getPrecision());
    System.out.println(stats.getRecall());

and the data in the file is:

 1,101,5.0
 1,102,3.0
 1,103,2.5
 2,101,2.0
 2,102,2.5
 2,103,5.0
 2,104,2.0
 3,101,2.5
 3,104,4.0
 3,105,4.5
 3,107,5.0
 4,101,5.0
 4,103,3.0
 4,104,4.5
 4,106,4.0
 5,101,4.0
 5,102,3.0
 5,103,2.0
 5,104,4.0
 5,105,3.5
 5,106,4.0

When running the code above on the data file, I got the

java.lang.IllegalArgumentException: Illegal precision: NaN
Why did this happen? I find something related here, but it is posted in 2009
and cannot explain my confusion.

  • 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-15T11:21:24+00:00Added an answer on June 15, 2026 at 11:21 am

    Ultimately, the error means that no precision or recall could be computed, and this is because the test data set is so small that no meaningful tests were possible. I don’t think it will be enough, but, change 0.5 to 1.0 and lower your threshold from 4 to 3.

    The IllegalArgumentException is just a cosmetic bug that shouldn’t occur. It was fixed in SVN a while ago. But it would just then show you that the precision and recall were undefined.

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

Sidebar

Related Questions

I have the following example code: $dataProvider = new CActiveDataProvider('firstTable', array('criteria' => array( 'select'
I have the following code example (see below). My problem is that the tooltip
I have the following C Header/Code Example: Header file struct category_info { int id;
Please help me to understand the following issue. Look at the code example below:
I have the following code example below. Whereby you can enter a command to
In the following code example how do the user/userParam references relate to the Customer
Possible Duplicate: C programming division in the following code example the result should yield
Please forgive the verbosity of the following code example. Using Delphi 2009, I created
Consider following SWT code example: http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet151.java?view=co How can I separate the inline defined class?
In the following (working) code example, the templated register_enum() function is used to iterate

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.