org.mymedialite.data
Class RatingsSimpleSplit

java.lang.Object
  extended by org.mymedialite.data.RatingsSimpleSplit
All Implemented Interfaces:
ISplit<IRatings>

public class RatingsSimpleSplit
extends java.lang.Object
implements ISplit<IRatings>

Simple split for rating prediction. Please note that simple splits are not the best/most realistic way of evaluating recommender system algorithms. In particular, chronological splits (see RatingsChronologicalSplit) are more realistic. The dataset must not be modified after the split - this would lead to undefined behavior.


Constructor Summary
RatingsSimpleSplit(IRatings ratings, double ratio)
          Create a simple split of rating prediction data.
 
Method Summary
 int numberOfFolds()
          The number of folds in this split.
 java.util.List<IRatings> test()
          Test data for the different folds.
 java.util.List<IRatings> train()
          Training data for the different folds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RatingsSimpleSplit

public RatingsSimpleSplit(IRatings ratings,
                          double ratio)
Create a simple split of rating prediction data.

Parameters:
ratings - the dataset
ratio - the ratio of ratings to use for validation
Method Detail

numberOfFolds

public int numberOfFolds()
Description copied from interface: ISplit
The number of folds in this split.

Specified by:
numberOfFolds in interface ISplit<IRatings>
Returns:
The number of folds in this split

train

public java.util.List<IRatings> train()
Description copied from interface: ISplit
Training data for the different folds.

Specified by:
train in interface ISplit<IRatings>
Returns:
A list of T

test

public java.util.List<IRatings> test()
Description copied from interface: ISplit
Test data for the different folds.

Specified by:
test in interface ISplit<IRatings>
Returns:
A list of T