Last active
August 29, 2015 14:08
-
-
Save mdekstrand/4f86eb836dc4ed35e995 to your computer and use it in GitHub Desktop.
LensKit Evaluator Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.grouplens.lenskit.iterative.* | |
| import org.grouplens.lenskit.knn.item.* | |
| import org.grouplens.lenskit.mf.funksvd.* | |
| import org.grouplens.lenskit.transform.normalize.* | |
| trainTest { | |
| dataset crossfold("ml-100k") { | |
| source csvfile("ml-100k/u.data") { | |
| delimiter "\t" | |
| domain { | |
| minimum 1.0 | |
| maximum 5.0 | |
| precision 1.0 | |
| } | |
| } | |
| } | |
| algorithm("PersMean") { | |
| bind ItemScorer to UserMeanItemScorer | |
| bind (UserMeanBaseline, ItemScorer) to ItemMeanRatingItemScorer | |
| } | |
| algorithm("ItemItem") { | |
| bind ItemScorer to ItemItemScorer | |
| bind UserVectorNormalizer to BaselineSubtractingUserVectorNormalizer | |
| within (UserVectorNormalizer) { | |
| bind (BaselineScorer, ItemScorer) to ItemMeanRatingItemScorer | |
| } | |
| } | |
| algorithm("FunkSVD") { | |
| bind ItemScorer to FunkSVDItemScorer | |
| bind UserVectorNormalizer to BaselineSubtractingUserVectorNormalizer | |
| bind (BaselineScorer, ItemScorer) to UserMeanItemScorer | |
| bind (UserMeanBaseline, ItemScorer) to ItemMeanRatingItemScorer | |
| set FeatureCount to 40 | |
| set LearningRate to 0.002 | |
| set IterationCount to 125 | |
| } | |
| metric CoveragePredictMetric | |
| metric RMSEPredictMetric | |
| metric NDCGPredictMetric | |
| output "eval-results.csv" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment