|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmain.Prea
public class Prea
The main class of this toolkit. It includes loading the dataset, splitting train/test set, and interface to evaluation for each algorithms.
Field Summary | |
---|---|
static java.lang.String[] |
columnName
The list of item names, provided with the dataset. |
static java.lang.String |
dataFileName
The name of data file used for test. |
static boolean |
ITEM_SIM_PREFETCH
Indicating whether loading pre-calculated item similarity file or not |
static int |
itemCount
The number of items. |
static SparseVector |
itemRateAverage
Average of ratings for each item. |
static int |
maxValue
Maximum value of rating, existing in the dataset. |
static int |
minValue
Minimum value of rating, existing in the dataset. |
static SparseMatrix |
rateMatrix
Rating matrix for each user (row) and item (column) |
static boolean |
SPLIT_PREFETCH
Indicating whether loading split file or not |
static double |
TEST_RATIO
Proportion of items which will be used for test purpose. |
static SparseMatrix |
testMatrix
Rating matrix for test items. |
static boolean |
USER_SIM_PREFETCH
Indicating whether loading pre-calculated user similarity file or not |
static int |
userCount
The number of users. |
static SparseVector |
userRateAverage
Average of ratings for each user. |
Constructor Summary | |
---|---|
Prea()
|
Method Summary | |
---|---|
private static void |
calculateAverage()
Calculate average of ratings for each user and each item. |
static void |
main(java.lang.String[] argv)
Test examples for every algorithm. |
private static void |
readArff(java.lang.String fileName)
Read the data file in ARFF format, and store it in rating matrix. |
private static void |
readSplitData(java.lang.String fileName)
Split the rating matrix into train and test set, by given split data file. |
private static void |
recoverTestItems()
Items in testMatrix are moved to original rateMatrix. |
private static void |
split(double testRatio)
Items which will be used for test purpose are moved from rateMatrix to testMatrix. |
static java.lang.String |
testRecommender(java.lang.String algorithmName,
Recommender r)
Test interface for a recommender system. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double TEST_RATIO
public static boolean SPLIT_PREFETCH
public static boolean USER_SIM_PREFETCH
public static boolean ITEM_SIM_PREFETCH
public static SparseMatrix rateMatrix
public static SparseMatrix testMatrix
public static SparseVector userRateAverage
public static SparseVector itemRateAverage
public static int userCount
public static int itemCount
public static int maxValue
public static int minValue
public static java.lang.String[] columnName
public static java.lang.String dataFileName
Constructor Detail |
---|
public Prea()
Method Detail |
---|
public static void main(java.lang.String[] argv)
argv
- The argument list. Each element is separated by an empty space.
First element is the data file name, and second one is the algorithm name.
Third and later includes parameters for the chosen algorithm.
Please refer to our web site for detailed syntax.public static java.lang.String testRecommender(java.lang.String algorithmName, Recommender r)
private static void split(double testRatio)
testRatio
- proportion of items which will be used for test purpose.private static void recoverTestItems()
private static void readArff(java.lang.String fileName)
fileName
- The name of data file.private static void readSplitData(java.lang.String fileName)
fileName
- the name of split data file.private static void calculateAverage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |