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

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


        for (int i = 0; i < prefsLength; i++) {
          addSomeOf(possibleItemsIDs, dataModel.getItemIDsFromUser(prefs.getUserID(i)));
        }
      }
    }
    possibleItemsIDs.removeAll(preferredItemIDs);
    return possibleItemsIDs;
  }
 
  private void addSomeOf(FastIDSet possibleItemIDs, FastIDSet itemIDs) {
    if (itemIDs.size() > maxItemsPerUser) {
View Full Code Here


          addSomeOf(possibleItemsIDs, dataModel.getItemIDsFromUser(prefs.getUserID(i)));
        }
      }
    }
    if (!includeKnownItems) {
      possibleItemsIDs.removeAll(preferredItemIDs);
    }
    return possibleItemsIDs;
  }

  private void addSomeOf(FastIDSet possibleItemIDs, FastIDSet itemIDs) {
View Full Code Here

    FastIDSet possibleItemIDs = new FastIDSet();
    for (long userID : theNeighborhood) {
      possibleItemIDs.addAll(dataModel.getItemIDsFromUser(userID));
    }
    if (!includeKnownItems) {
      possibleItemIDs.removeAll(dataModel.getItemIDsFromUser(theUserID));
    }
    return possibleItemIDs;
  }
 
  @Override
View Full Code Here

    FastIDSet possibleItemIDs = new FastIDSet();
    for (long userID : theNeighborhood) {
      possibleItemIDs.addAll(dataModel.getItemIDsFromUser(userID));
    }
    if (!includeKnownItems) {
      possibleItemIDs.removeAll(dataModel.getItemIDsFromUser(theUserID));
    }
    return possibleItemIDs;
  }
 
  @Override
View Full Code Here

    LongPrimitiveIterator allItemIDs = dataModel.getItemIDs();
    while (allItemIDs.hasNext()) {
      possibleItemIDs.add(allItemIDs.nextLong());
    }
    if (!includeKnownItems) {
      possibleItemIDs.removeAll(preferredItemIDs);
    }
    return possibleItemIDs;
  }
}
View Full Code Here

    FastIDSet candidateItemIDs = new FastIDSet();
    for (long itemID : preferredItemIDs) {
      candidateItemIDs.addAll(similarity.allSimilarItemIDs(itemID));
    }
    if (!includeKnownItems) {
      candidateItemIDs.removeAll(preferredItemIDs);
    }
    return candidateItemIDs;
  }
}
View Full Code Here

      for (int index = 0; index < numUsersPreferringItem; index++) {
        possibleItemsIDs.addAll(dataModel.getItemIDsFromUser(itemPreferences.getUserID(index)));
      }
    }
    if (!includeKnownItems) {
      possibleItemsIDs.removeAll(preferredItemIDs);
    }
    return possibleItemsIDs;
  }

}
View Full Code Here

    long[] seenItemIDs) throws TasteException {
      FastIDSet possibleItemsIDs = new FastIDSet();
      possibleItemsIDs.addAll(this.validItemIDs);

      if (seenItemIDs != null)
        possibleItemsIDs.removeAll(seenItemIDs);

      return possibleItemsIDs;
  }

  // override for AbstractCandidateItemsStrategy
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.