Examples of sortByItem()


Examples of org.apache.mahout.cf.taste.model.PreferenceArray.sortByItem()

        nextRank += 1.0f;
      }
    }
   
    xPrefs.sortByItem();
    yPrefs.sortByItem();
   
    long xIndex = xPrefs.getItemID(0);
    long yIndex = yPrefs.getItemID(0);
    int xPrefIndex = 0;
    int yPrefIndex = 0;
View Full Code Here

Examples of org.apache.mahout.cf.taste.model.PreferenceArray.sortByItem()

    FastByIDMap<Collection<Preference>> prefsForItems = new FastByIDMap<Collection<Preference>>();
    FastIDSet itemIDSet = new FastIDSet();
    int currentCount = 0;
    for (Map.Entry<Long,PreferenceArray> entry : preferenceFromUsers.entrySet()) {
      PreferenceArray prefs = entry.getValue();
      prefs.sortByItem();
      for (Preference preference : prefs) {
        long itemID = preference.getItemID();
        itemIDSet.add(itemID);
        List<Preference> prefsForItem = (List<Preference>) prefsForItems.get(itemID);
        if (prefsForItem == null) {
View Full Code Here

Examples of org.apache.mahout.cf.taste.model.PreferenceArray.sortByItem()

    int currentCount = 0;
    float maxPrefValue = Float.NEGATIVE_INFINITY;
    float minPrefValue = Float.POSITIVE_INFINITY;
    for (Map.Entry<Long, PreferenceArray> entry : preferenceFromUsers.entrySet()) {
      PreferenceArray prefs = entry.getValue();
      prefs.sortByItem();
      for (Preference preference : prefs) {
        long itemID = preference.getItemID();
        itemIDSet.add(itemID);
        List<Preference> prefsForItem = (List<Preference>) prefsForItems.get(itemID);
        if (prefsForItem == null) {
View Full Code Here

Examples of org.apache.mahout.cf.taste.model.PreferenceArray.sortByItem()

        nextRank += 1.0f;
      }
    }
   
    xPrefs.sortByItem();
    yPrefs.sortByItem();
   
    long xIndex = xPrefs.getItemID(0);
    long yIndex = yPrefs.getItemID(0);
    int xPrefIndex = 0;
    int yPrefIndex = 0;
View Full Code Here

Examples of org.apache.mahout.cf.taste.model.PreferenceArray.sortByItem()

    int currentCount = 0;
    float maxPrefValue = Float.NEGATIVE_INFINITY;
    float minPrefValue = Float.POSITIVE_INFINITY;
    for (Map.Entry<Long, PreferenceArray> entry : preferenceFromUsers.entrySet()) {
      PreferenceArray prefs = entry.getValue();
      prefs.sortByItem();
      for (Preference preference : prefs) {
        long itemID = preference.getItemID();
        itemIDSet.add(itemID);
        Collection<Preference> prefsForItem = prefsForItems.get(itemID);
        if (prefsForItem == null) {
View Full Code Here

Examples of org.apache.mahout.cf.taste.model.PreferenceArray.sortByItem()

  public void testSort() {
    PreferenceArray prefs = new BooleanUserPreferenceArray(3);
    prefs.set(0, new BooleanPreference(1L, 3L));
    prefs.set(1, new BooleanPreference(1L, 1L));
    prefs.set(2, new BooleanPreference(1L, 2L));
    prefs.sortByItem();
    assertEquals(1L, prefs.getItemID(0));
    assertEquals(2L, prefs.getItemID(1));
    assertEquals(3L, prefs.getItemID(2));
  }
View Full Code Here

Examples of org.apache.mahout.cf.taste.model.PreferenceArray.sortByItem()

  public void testSort() {
    PreferenceArray prefs = new GenericUserPreferenceArray(3);
    prefs.set(0, new GenericPreference(1L, 3L, 5.0f));
    prefs.set(1, new GenericPreference(1L, 1L, 5.0f));
    prefs.set(2, new GenericPreference(1L, 2L, 5.0f));
    prefs.sortByItem();
    assertEquals(1L, prefs.getItemID(0));
    assertEquals(2L, prefs.getItemID(1));
    assertEquals(3L, prefs.getItemID(2));   
  }
View Full Code Here

Examples of org.apache.mahout.cf.taste.model.PreferenceArray.sortByItem()

        nextRank += 1.0f;
      }
    }
   
    xPrefs.sortByItem();
    yPrefs.sortByItem();
   
    long xIndex = xPrefs.getItemID(0);
    long yIndex = yPrefs.getItemID(0);
    int xPrefIndex = 0;
    int yPrefIndex = 0;
View Full Code Here

Examples of org.apache.mahout.cf.taste.model.PreferenceArray.sortByItem()

    FastByIDMap<Collection<Preference>> prefsForItems = new FastByIDMap<Collection<Preference>>();
    FastIDSet itemIDSet = new FastIDSet();
    int currentCount = 0;
    for (Map.Entry<Long, PreferenceArray> entry : preferenceFromUsers.entrySet()) {
      PreferenceArray prefs = entry.getValue();
      prefs.sortByItem();
      for (Preference preference : prefs) {
        long itemID = preference.getItemID();
        itemIDSet.add(itemID);
        List<Preference> prefsForItem = (List<Preference>) prefsForItems.get(itemID);
        if (prefsForItem == null) {
View Full Code Here

Examples of org.apache.mahout.cf.taste.model.PreferenceArray.sortByItem()

        nextRank += 1.0f;
      }
    }

    xPrefs.sortByItem();
    yPrefs.sortByItem();

    long xIndex = xPrefs.getItemID(0);
    long yIndex = yPrefs.getItemID(0);
    int xPrefIndex = 0;
    int yPrefIndex = 0;
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.