org.mymedialite.io
Class ItemData
java.lang.Object
org.mymedialite.io.ItemData
public class ItemData
- extends java.lang.Object
Class that contains static methods for reading in implicit feedback data for ItemRecommenders.
Method Summary |
static
|
read(java.io.BufferedReader reader,
IEntityMapping user_mapping,
IEntityMapping item_mapping,
boolean ignore_first_line)
Read in implicit feedback data from a TextReader. |
static
|
read(java.lang.String filename,
IEntityMapping user_mapping,
IEntityMapping item_mapping,
boolean ignore_first_line)
Read in implicit feedback data from a file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ItemData
public ItemData()
read
public static <T> IPosOnlyFeedback read(java.lang.String filename,
IEntityMapping user_mapping,
IEntityMapping item_mapping,
boolean ignore_first_line)
throws java.lang.Exception
- Read in implicit feedback data from a file.
Each line must consist of at least two fields, the first being a user identifier, the second
being an item identifier. Additional fields and empty lines are ignored.
See Constants.SPLIT_CHARS for details of the permissible field separators.
- Parameters:
filename
- the name of the file to be read from or "-" if STDINuser_mapping
- a user IEntityMapping objectitem_mapping
- an item IEntityMapping objectignore_first_line
- if true, ignore the first line
- Returns:
- a IPosOnlyFeedback object with the user-wise collaborative data
- Throws:
java.lang.Exception
read
public static <T> IPosOnlyFeedback read(java.io.BufferedReader reader,
IEntityMapping user_mapping,
IEntityMapping item_mapping,
boolean ignore_first_line)
throws java.lang.Exception
- Read in implicit feedback data from a TextReader.
Each line must consist of at least two fields, the first being a user identifier, the second
being an item identifier. Additional fields and empty lines are ignored.
See Constants.SPLIT_CHARS for details of the permissible field separators.
- Parameters:
reader
- the TextReader to be read fromuser_mapping
- a user IEntityMapping objectitem_mapping
- an item IEntityMapping objectignore_first_line
- if true, ignore the first line
- Returns:
- a PosOnlyFeedback object with the user-wise collaborative data
- Throws:
java.lang.Exception