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

  • Home
  • SEARCH
  • 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 6218599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:38:18+00:00 2026-05-24T07:38:18+00:00

I need to work on a project using open source software, mahout. An example

  • 0

I need to work on a project using open source software, mahout. An example program
is as follows.

import org.apache.mahout.cf.taste.common.Refreshable;
import org.apache.mahout.cf.taste.impl.common.FastIDSet;
import org.apache.mahout.cf.taste.similarity.ItemSimilarity;
public class GenderItemSimilarity implements ItemSimilarity {

   private final FastIDSet men;
   private final FastIDSet women;
   public GenderItemSimilarity(FastIDSet men, FastIDSet women) {
       this.men = men;
       this.women = women;
   }

   public double itemSimilarity(long profileID1, long profileID2) {
      Boolean profile1IsMan = isMan(profileID1);
      if (profile1IsMan == null) {
      return 0.0;
   }
   Boolean profile2IsMan = isMan(profileID2);
      if (profile2IsMan == null) {
        return 0.0;
      }
   return profile1IsMan == profile2IsMan ? 1.0 : -1.0;
   }

 public double[] itemSimilarities(long itemID1, long[] itemID2s) {
    double[] result = new double[itemID2s.length];
    for (int i = 0; i < itemID2s.length; i++) {
     result[i] = itemSimilarity(itemID1, itemID2s[i]);
    }
   return result;
 }

private Boolean isMan(long profileID) {
  if (men.contains(profileID)) {
  return Boolean.TRUE;
 }
if (women.contains(profileID)) {
    return Boolean.FALSE;
  }
   return null;
}

public void refresh(Collection<Refreshable> alreadyRefreshed) {
  // do nothing
 }
}

The eclipse compiler gives the error message such as

The type GenderItemSimilarity must implement the inherited abstract method ItemSimilarity.allSimilarItemIDs(long)

It seems to me that this error message indicates that there exists a class ItemSimilarity, which has a method of allSimilarItemIDs(long). However, the current program does not have this method. Is my analysis correct? Will adding this kind of method solve the issue?

  • 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-05-24T07:38:19+00:00Added an answer on May 24, 2026 at 7:38 am

    This is a snippet from the book Mahout in Action. (I’m an author.) I don’t think this is the complete, latest source code that accompanies the book. Make sure to get the latest, which at the moment is not at Manning, but lives (and will live) on Github.

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

Sidebar

Related Questions

In my open source project which is licensed under LGPLv3 I need a small
I am a Java programmer and need to work on a Flex/ActionScript project right
I need my program to work only with certain USB Flash drives (from a
I need to work with MSMQ (Microsoft Message Queuing). What is it, what is
I need to work with array from several threads, so I use CRITICAL SECTION
Every time I need to work with date and/or timstamps in Java I always
I have a situation where I need to work with a datagrid and adding
For my work I need to create a Autorun application for a CD for
I need to do some work with a backup WSS .dat file and I'm
I'm work in an aplication that need be capable of support plugins, but i

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.