You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the following code to build a model using PMFRecommender. If I want to get all recommendations for a particular user, instead of calling getRecommendedList() and filtering for the user, is there a method, say predict(user) that returns items with score for a particular user?
Also,
RecommenderSimilarity is not required to be added to the RecommenderContext if we are using Matrix Factorization algorithms, right?
What configuration parameters are available and possible values for PMFRecommender and NMFRecommender ?
I get a precision and recall values as following for the following code and config. Is the code correct or is there anything I am missing? Precision: NaN Recall: 0.0
Also, the recommended list keeps changing for every run? Is there a property I need to set to keep the recommendations constant?
How can I specify ARFF input instead of text and get the predictions ?
```
Configuration conf = new Configuration();
Resource resource = new Resource("pmf-test.properties");
conf.addResource(resource);
// build data model
DataModel dataModel = new TextDataModel(conf);
dataModel.buildDataModel();
// set recommendation context
RecommenderContext context = new RecommenderContext(conf, dataModel);
// RecommenderSimilarity similarity = new PCCSimilarity();
// similarity.buildSimilarityMatrix(dataModel);
// context.setSimilarity(similarity);
// training
Recommender recommender = new PMFRecommender();
recommender.recommend(context);
// evaluation
RecommenderEvaluator maeEvaluator = new MAEEvaluator();
double mae = recommender.evaluate(maeEvaluator);
RecommenderEvaluator rmseEvaluator = new RMSEEvaluator();
double rmse = recommender.evaluate(rmseEvaluator);
RecommenderEvaluator precisionEvaluator = new PrecisionEvaluator();
double precision = recommender.evaluate(precisionEvaluator);
RecommenderEvaluator recallEvaluator = new RecallEvaluator();
double recall = recommender.evaluate(recallEvaluator);
System.out.println("MAE:" + mae);
System.out.println("RMSE:" + rmse);
System.out.println("Precision: " + precision);
System.out.println("Recall: " + recall);
// recommendation results
List<RecommendedItem> recommendedItemList = recommender.getRecommendedList();
List<String> userIds = new ArrayList<String>();
userIds.add("836");
RecommendedFilter filter = new GenericRecommendedFilter();
((GenericRecommendedFilter) filter).setUserIdList(userIds);
recommendedItemList = filter.filter(recommendedItemList);
Map<String, Double> recommendedItems = new HashMap<String, Double>();
System.out.println("Recommendations for User 836");
for(RecommendedItem item : recommendedItemList) {
if(item.getUserId().equals("836")) {
System.out.println(item.getUserId() + " : " + item.getItemId() + " : " + item.getValue());
}
}
I am using the following code to build a model using PMFRecommender. If I want to get all recommendations for a particular user, instead of calling
getRecommendedList
() and filtering for the user, is there a method, say predict(user) that returns items with score for a particular user?Also,
RecommenderSimilarity is not required to be added to the RecommenderContext if we are using Matrix Factorization algorithms, right?
What configuration parameters are available and possible values for PMFRecommender and NMFRecommender ?
I get a precision and recall values as following for the following code and config. Is the code correct or is there anything I am missing?
Precision: NaN Recall: 0.0
Also, the recommended list keeps changing for every run? Is there a property I need to set to keep the recommendations constant?
How can I specify ARFF input instead of text and get the predictions ?
dfs.data.dir=/Users/sv/Datasets/
dfs.result.dir=/Users/sv/Datasets/
data.input.path=ml-100k/ratings.txt
data.column.format=UIR
data.model.splitter=ratio
data.splitter.ratio=rating
data.model.format=text
data.splitter.trainset.ratio=0.8
rec.random.seed=1
data.convert.binarize.threshold=-1.0
rec.eval.enable=true
rec.recommender.isranking=false
rec.recommender.class=pmf
rec.iterator.learnrate=0.01
rec.iterator.learnrate.maximum=0.01
rec.iterator.maximum=50
rec.user.regularization=0.08
rec.item.regularization=0.08
rec.factor.number=6
rec.learnrate.bolddriver=false
rec.learnrate.decay=1.0
The text was updated successfully, but these errors were encountered: