Example usage for org.apache.mahout.cf.taste.impl.recommender GenericItemBasedRecommender GenericItemBasedRecommender

List of usage examples for org.apache.mahout.cf.taste.impl.recommender GenericItemBasedRecommender GenericItemBasedRecommender

Introduction

In this page you can find the example usage for org.apache.mahout.cf.taste.impl.recommender GenericItemBasedRecommender GenericItemBasedRecommender.

Prototype

public GenericItemBasedRecommender(DataModel dataModel, ItemSimilarity similarity,
            CandidateItemsStrategy candidateItemsStrategy,
            MostSimilarItemsCandidateItemsStrategy mostSimilarItemsCandidateItemsStrategy) 

Source Link

Usage

From source file:io.spring.springoverflow.Application.java

License:Apache License

@Bean
ItemBasedRecommender recommender(DataSource dataSource) throws Exception {
    DataModel dataModel = new MySQLBooleanPrefJDBCDataModel(dataSource);
    ItemSimilarity similarity = new MySQLJDBCInMemoryItemSimilarity(dataSource);
    AllSimilarItemsCandidateItemsStrategy candidateItemsStrategy = new AllSimilarItemsCandidateItemsStrategy(
            similarity);/* w w  w . ja  v a  2  s.  c  om*/
    return new GenericItemBasedRecommender(dataModel, similarity, candidateItemsStrategy,
            candidateItemsStrategy);
}