public class GivenNDataSplitter extends AbstractDataSplitter
DataSplitter.SplitterType
dataConvertor, LOG, testMatrix, trainMatrix, validationMatrix
conf, CONF_DATA_COLUMN_FORMAT, CONF_DATA_INPUT_PATH, CONF_DFS_DATA_DIR
Constructor and Description |
---|
GivenNDataSplitter()
Empty constructor.
|
GivenNDataSplitter(DataConvertor dataConvertor,
Configuration conf)
Initializes a newly created
GivenNDataSplitter object
with configuration. |
Modifier and Type | Method and Description |
---|---|
void |
getGivenNByItem(int numGiven)
Split ratings into two parts: the training set consisting of user-item
ratings where
numGiven ratings are preserved for each item, and
the rest are used as the testing data. |
void |
getGivenNByItemDate(int numGiven)
Split ratings into two parts: the training set consisting of user-item
ratings where
numGiven earliest ratings are preserved for each
item, and the rest are used as the testing data. |
void |
getGivenNByUser(int numGiven)
Split ratings into two parts: the training set consisting of user-item
ratings where
numGiven ratings are preserved for each user, and
the rest are used as the testing data. |
void |
getGivenNByUserDate(int numGiven)
Split ratings into two parts: the training set consisting of user-item
ratings where
numGiven earliest ratings are preserved for each
user, and the rest are used as the testing data. |
void |
splitData()
Split the data.
|
getTestData, getTrainData, getValidData, setDataConvertor
getConf, setConf
public GivenNDataSplitter()
public GivenNDataSplitter(DataConvertor dataConvertor, Configuration conf)
GivenNDataSplitter
object
with configuration.dataConvertor
- data convertorconf
- the configuration for the splitter.public void splitData() throws LibrecException
LibrecException
- if error occurspublic void getGivenNByUser(int numGiven) throws java.lang.Exception
numGiven
ratings are preserved for each user, and
the rest are used as the testing data.numGiven
- given numberjava.lang.Exception
- if error occurspublic void getGivenNByUserDate(int numGiven)
numGiven
earliest ratings are preserved for each
user, and the rest are used as the testing data.numGiven
- given numberpublic void getGivenNByItem(int numGiven) throws java.lang.Exception
numGiven
ratings are preserved for each item, and
the rest are used as the testing data.numGiven
- given numberjava.lang.Exception
- if error occurspublic void getGivenNByItemDate(int numGiven)
numGiven
earliest ratings are preserved for each
item, and the rest are used as the testing data.numGiven
- given numberCopyright © 2017. All Rights Reserved.