MovieLens 1M/10M rating data files
The MovieLens 1M and 10M datasets use a double colon ::
as separator.
Rating data files have at least three columns: the user ID, the item ID, and the rating value. The user and item IDs are non-negative long (64 bit) integers, and the rating value is a double (64 bit floating point number).
Examples
Rating data
5951::50::5 5951::223::5 5951::260::5 5951::293::5 5951::356::4 5951::364::3 5951::457::3
Rating data with timestamps
5951::50::5::978300760 5951::223::5::978302109 5951::260::5::978301968 5951::293::5::978300275 5951::356::4::978824291 5951::364::3::978302268 5951::457::3::978300719
Command-line tools
Rating prediction
MyMediaLite's rating prediction tool supports the MovieLens 1M/10M file format for its --training-data=FILE
and --test-data=FILE
arguments.
All you need to do is to tell the program that your files are in this specific format: --file-format=movielems_1m
For prediction, if you use --prediction-file=FILE
, you will get a tab-separated file with predictions for the test data.
With the --prediction-line="FORMAT"
you can modify the line format, e.g. if you want the lines to be in the MovieLens 1M/10M format:
--prediction-line="{0}::{1}::{2}"
.
Item recommendation
The item recommendation tool currently does not support this rating data format. We plan to change this in the future. Have a look at the Contribute page if you want to help us.
Classes
Reading
The classes implementing reading in this kind of rating data are
MyMediaLite.IO.MovieLensRatingData
Writing
MyMediaLite.RatingPrediction.Prediction
contains a static method WritePredictions()
that lets you write the predictions to a target, either a file or a TextWriter
, for example:
Prediction.WritePredictions(recommender, ratings, user_mapping, item_mapping, target, "{0}::{1}::{2}");