Example usage for org.apache.mahout.cf.taste.impl.model.jdbc MySQLBooleanPrefJDBCDataModel MySQLBooleanPrefJDBCDataModel

List of usage examples for org.apache.mahout.cf.taste.impl.model.jdbc MySQLBooleanPrefJDBCDataModel MySQLBooleanPrefJDBCDataModel

Introduction

In this page you can find the example usage for org.apache.mahout.cf.taste.impl.model.jdbc MySQLBooleanPrefJDBCDataModel MySQLBooleanPrefJDBCDataModel.

Prototype

public MySQLBooleanPrefJDBCDataModel(DataSource dataSource) 

Source Link

Document

Creates a MySQLBooleanPrefJDBCDataModel using the given javax.sql.DataSource and default table/column names.

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);//from w  w w  .jav a2s.c o m
    return new GenericItemBasedRecommender(dataModel, similarity, candidateItemsStrategy,
            candidateItemsStrategy);
}