Package org.apache.mahout.cf.taste.impl.common

Examples of org.apache.mahout.cf.taste.impl.common.FastIDSet.intersectionSize()


  @Override
  public int getNumUsersWithPreferenceFor(long itemID1, long itemID2) throws TasteException {
    FastIDSet userIDs1 = userIDsFromItemCache.get(itemID1);
    FastIDSet userIDs2 = userIDsFromItemCache.get(itemID2);
    return userIDs1.size() < userIDs2.size()
        ? userIDs2.intersectionSize(userIDs1)
        : userIDs1.intersectionSize(userIDs2);
  }

  @Override
  public void setPreference(long userID, long itemID, float value) {
View Full Code Here


    FastIDSet userIDs2 = preferenceForItems.get(itemID2);
    if (userIDs2 == null) {
      return 0;
    }
    return userIDs1.size() < userIDs2.size() ?
        userIDs2.intersectionSize(userIDs1) :
        userIDs1.intersectionSize(userIDs2);
  }
 
  @Override
  public void removePreference(long userID, long itemID) {
View Full Code Here

  @Override
  public int getNumUsersWithPreferenceFor(long itemID1, long itemID2) throws TasteException {
    FastIDSet userIDs1 = userIDsFromItemCache.get(itemID1);
    FastIDSet userIDs2 = userIDsFromItemCache.get(itemID2);
    return userIDs1.size() < userIDs2.size() ?
        userIDs2.intersectionSize(userIDs1) :
        userIDs1.intersectionSize(userIDs2);
  }

  @Override
  public void setPreference(long userID, long itemID, float value) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.