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

Examples of org.apache.mahout.cf.taste.common.NoSuchItemException


  @Override
  public PreferenceArray getPreferencesForItem(long itemID) throws TasteException {
    List<Preference> list = doGetPreferencesForItem(itemID);
    if (list.isEmpty()) {
      throw new NoSuchItemException();
    }
    return new GenericItemPreferenceArray(list);
  }
View Full Code Here


    if (useridx == null) {
      throw new NoSuchUserException();
    }
    Integer itemidx = itemMap.get(itemID);
    if (itemidx == null) {
      throw new NoSuchItemException();
    }
    return predictRating(useridx, itemidx);
  }
View Full Code Here

   */
  @Override
  public Item getItem(Object id) throws NoSuchItemException {
    Item item = itemMap.get(id);
    if (item == null) {
      throw new NoSuchItemException();
    }
    return item;
  }
View Full Code Here

  }

  public double[] getItemFeatures(long itemID) throws NoSuchItemException {
    Integer index = itemIDMapping.get(itemID);
    if (index == null) {
      throw new NoSuchItemException(itemID);
    }
    return itemFeatures[index];
  }
View Full Code Here

  }

  public int itemIndex(long itemID) throws NoSuchItemException {
    Integer index = itemIDMapping.get(itemID);
    if (index == null) {
      throw new NoSuchItemException(itemID);
    }
    return index;
  }
View Full Code Here

      newPreferenceArray.set(prefsCounter++, anonymousPreference);
    }

    if (newPreferenceArray.length() == 0) {
      // No, didn't find it among the anonymous user prefs
      throw new NoSuchItemException(itemID);
    }

    return newPreferenceArray;
  }
View Full Code Here

 
  @Override
  public PreferenceArray getPreferencesForItem(long itemID) throws NoSuchItemException {
    PreferenceArray prefs = preferenceForItems.get(itemID);
    if (prefs == null) {
      throw new NoSuchItemException(itemID);
    }
    return prefs;
  }
View Full Code Here

 
  @Override
  public PreferenceArray getPreferencesForItem(long itemID) throws NoSuchItemException {
    FastIDSet userIDs = preferenceForItems.get(itemID);
    if (userIDs == null) {
      throw new NoSuchItemException(itemID);
    }
    PreferenceArray prefArray = new BooleanItemPreferenceArray(userIDs.size());
    int i = 0;
    LongPrimitiveIterator it = userIDs.iterator();
    while (it.hasNext()) {
View Full Code Here

  @Override
  public PreferenceArray getPreferencesForItem(long itemID) throws TasteException {
    List<Preference> list = doGetPreferencesForItem(itemID);
    if (list.isEmpty()) {
      throw new NoSuchItemException(itemID);
    }
    return new GenericItemPreferenceArray(list);
  }
View Full Code Here

        return cloneAndMergeInto(delegatePrefs, itemID, tempPrefs.getUserID(i), tempPrefs.getValue(i));
      }
    }
    if (delegatePrefs == null) {
      // No, didn't find it among the anonymous user prefs
      throw new NoSuchItemException(itemID);
    }
    return delegatePrefs;
  }
View Full Code Here

TOP

Related Classes of org.apache.mahout.cf.taste.common.NoSuchItemException

Copyright © 2018 www.massapicom. 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.