org.mymedialite.io
Class ItemData

java.lang.Object
  extended by org.mymedialite.io.ItemData

public class ItemData
extends java.lang.Object

Class that contains static methods for reading in implicit feedback data for ItemRecommenders.


Constructor Summary
ItemData()
           
 
Method Summary
static
<T> IPosOnlyFeedback
read(java.io.BufferedReader reader, IEntityMapping user_mapping, IEntityMapping item_mapping, boolean ignore_first_line)
          Read in implicit feedback data from a TextReader.
static
<T> IPosOnlyFeedback
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
 

Constructor Detail

ItemData

public ItemData()
Method Detail

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 STDIN
user_mapping - a user IEntityMapping object
item_mapping - an item IEntityMapping object
ignore_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 from
user_mapping - a user IEntityMapping object
item_mapping - an item IEntityMapping object
ignore_first_line - if true, ignore the first line
Returns:
a PosOnlyFeedback object with the user-wise collaborative data
Throws:
java.lang.Exception