= org.apache.mahout.cf.taste.impl.model.jdbc. PostgreSQLJDBCDataModel.new(connection, 'stars', 'user_id', 'repo_id', 'preference', 'created_at') data = org.apache.mahout.cf.taste.impl.model.jdbc. ReloadFromJDBCDataModel.new(model) similarity = org.apache.mahout.cf.taste.impl.similarity. TanimotoCoefficientSimilarity.new(data) neighborhood = org.apache.mahout.cf.taste.impl.neighborhood. NearestNUserNeighborhood.new(5, similarity, data) recommender = org.apache.mahout.cf.taste.impl.recommender. GenericBooleanPrefUserBasedRecommender.new(data, neighborhood, similarity) recommendations = recommender.recommend user_id, 30 update_recommendations connection, recommendations, user_id connection.close end http://goo.gl/dEAp9 JAVA CODE! Saturday, December 15, 12