Skip to content

Instantly share code, notes, and snippets.

View eval.groovy
import org.grouplens.lenskit.knn.item.*
import org.grouplens.lenskit.transform.normalize.*
import org.grouplens.lenskit.eval.metrics.topn.*;
trainTest {
dataset crossfold("ml-100k") {
source csvfile("ml-100k/u.data"){ // relative (or absolute) path to the dataset. In the current format, it assumes that you have a folder named "ml-100k" containing the "u.data" file
delimiter "\t"
domain {
View eval_derived_class.groovy
import org.grouplens.lenskit.knn.item.*
import org.grouplens.lenskit.baseline.*
import org.grouplens.lenskit.transform.normalize.*
import org.grouplens.lenskit.ItemScorer
import org.grouplens.lenskit.baseline.ItemMeanRatingItemScorer
import org.grouplens.lenskit.core.Transient
import org.grouplens.lenskit.data.dao.EventDAO
import org.grouplens.lenskit.data.dao.UserDAO
import org.grouplens.lenskit.eval.data.traintest.QueryData
View eval_final.groovy
import org.grouplens.lenskit.knn.item.*
import org.grouplens.lenskit.baseline.*
import org.grouplens.lenskit.transform.normalize.*
import org.grouplens.lenskit.eval.metrics.topn.*;
import org.grouplens.lenskit.ItemScorer
import org.grouplens.lenskit.baseline.ItemMeanRatingItemScorer
import org.grouplens.lenskit.core.Transient
import org.grouplens.lenskit.data.dao.EventDAO
import org.grouplens.lenskit.data.dao.UserDAO
import org.grouplens.lenskit.eval.data.traintest.QueryData
@vikumn
vikumn / item_mean.py
Last active Aug 29, 2015
The sample external recommender written in Python
View item_mean.py
import sys
class ItemMeanData(object):
def __init__(self):
self.global_sum = 0
self.global_count = 0
self.item_sums = {}
self.item_counts = {}
View saavn.js
/**
* Chrome-Last.fm-Scrobbler - Saavn.com Connector
*
* Author: Vikas Kumar [vikas@cs.umn.edu]
* Derived from Sitesh Shrivastava code on gaana.js
*/
// DOM Nodes to keep track for song details
var SONG_TRACK_DOM = '#player-track-name';
var SONG_ALBUM_DOM = '#player-album-name';