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

Examples of org.apache.mahout.cf.taste.impl.model.GenericDataModel


      if (random.nextDouble() < evaluationPercentage) {
        processOneUser(trainingPercentage, trainingUsers, testUserPrefs, userID, dataModel);
      }
    }
   
    DataModel trainingModel = dataModelBuilder == null ? new GenericDataModel(trainingUsers)
        : dataModelBuilder.buildDataModel(trainingUsers);
   
    Recommender recommender = recommenderBuilder.buildRecommender(trainingModel);
   
    double result = getEvaluation(testUserPrefs, recommender);
View Full Code Here


      }
      if (!prefsList.isEmpty()) {
        result.put(userIDs[i], new GenericUserPreferenceArray(prefsList));
      }
    }
    return new GenericDataModel(result);
  }
View Full Code Here

            mongoTimestamp = getDate(user.get("created_at"));
          }
        }
      }
    }
    delegate = new GenericDataModel(GenericDataModel.toDataMap(userIDPrefMap, true));
  }
View Full Code Here

            removeMongoUserItem(Long.toString(userID), Long.toString(itemID));
          }
        }
      }
    }
    return new GenericDataModel(rawData);
  }
View Full Code Here

                           Long.toString(itemID),
                           Float.toString(preferenceValue));
        }
      }
    }
    return new GenericDataModel(rawData);
  }
View Full Code Here

   
    log.info("Reading preference data...");
    FastByIDMap<PreferenceArray> users = readUsers(dataDirectory);
   
    log.info("Creating delegate DataModel...");
    delegate = new GenericDataModel(users);
  }
View Full Code Here

   
    log.info("Reading preference data...");
    FastByIDMap<PreferenceArray> users = readUsers(dataDirectory);
   
    log.info("Creating delegate DataModel...");
    delegate = new GenericDataModel(users);
  }
View Full Code Here

        for (File updateFile : findUpdateFiles()) {
          processFile(new FileLineIterator(updateFile, false), data, timestamps, false);
        }

        return new GenericDataModel(GenericDataModel.toDataMap(data, true), timestamps);

      } else {

        FastByIDMap<PreferenceArray> rawData = ((GenericDataModel) delegate).getRawUserData();

        for (File updateFile : findUpdateFiles()) {
          processFile(new FileLineIterator(updateFile, false), rawData, timestamps, true);
        }

        return new GenericDataModel(rawData, timestamps);

      }

    } else {
View Full Code Here

  protected DataModel buildModel() throws IOException {
    FastByIDMap<Collection<Preference>> data = new FastByIDMap<Collection<Preference>>();
    FileLineIterator iterator = new FileLineIterator(getDataFile(), false);
    FastByIDMap<FastByIDMap<Long>> timestamps = new FastByIDMap<FastByIDMap<Long>>();
    processFile(iterator, data, timestamps, false);
    return new GenericDataModel(GenericDataModel.toDataMap(data, true));
  }
View Full Code Here

    log.info("Reading preference data...");
    List<User> users = readUsers(dataDirectory, movies);

    log.info("Creating delegate DataModel...");
    delegate = new GenericDataModel(users);
  }
View Full Code Here

TOP

Related Classes of org.apache.mahout.cf.taste.impl.model.GenericDataModel

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.