|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.recommender.algorithms.AutoTester
A class containing test code to be run immediately upon server loading. Evaluates the effectiveness of an implemented algorithm using metrics defined in TestStats. Includes a rating test for generic training/test splits and an all-but-one test, for comparing to published papers that use all-but-one tests. Testing for top-N recommendations is in progress, but doesn't yet work very well so it has been commented out. Note: to run the autotest mode, we need a different table format from the server mode: autotest mode need four columns in the RATING_TABLE: UserID, ItemID, Rating and RatingSet.
Field Summary | |
(package private) static int |
givenNparam
|
(package private) static int |
NUM_RECS
|
(package private) static int |
numParam
Test the quality of an algorithm's Top N recommendations. |
(package private) static int |
reduceSetOpt
|
Constructor Summary | |
AutoTester(DataManager dataMgr,
java.lang.Class algorithm)
Construct an AutoTester object to test the provided algorithm using data from the provided data manager. |
Method Summary | |
protected void |
addCachedRatings(java.util.Iterator ratings)
Add ratings to cache. |
void |
allButOne(java.util.Iterator ratings)
Run an all-but-one test, given an iterator of ratings representing the test set. |
protected void |
removeCachedRatings(java.util.Iterator ratings)
Remove ratings from cache |
static void |
runTests(DataManager dataMgr,
java.lang.Class algorithm,
java.lang.String whereClause)
Run automated tests and return the results using the provided algorithm, data manager. |
protected void |
testCachedRatings(java.util.Iterator ratings,
TestStats testStats)
Run test for one user - the one just added in cache, and add results to testStats. |
void |
testRatings(java.util.Iterator iter)
Run a training/test split rating test, given an iterator of ratings representing the test set. |
void |
testRecommendations2(java.util.Iterator iter1)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final int numParam
static final int reduceSetOpt
static final int givenNparam
static final int NUM_RECS
Constructor Detail |
public AutoTester(DataManager dataMgr, java.lang.Class algorithm)
dataMgr
- data manager to provide ratings and other support
services.algorithm
- algorithm to testMethod Detail |
public static void runTests(DataManager dataMgr, java.lang.Class algorithm, java.lang.String whereClause)
dataMgr
- data manager to provide ratings and other support
services.algorithm
- algorithm to testwhereClause
- place to load the testsetpublic void allButOne(java.util.Iterator ratings)
ratings
- Iterator of all ItemRatings in the test set, grouped
by UserID.protected void addCachedRatings(java.util.Iterator ratings)
ratings
- the tested user's iter of ItemRatingprotected void removeCachedRatings(java.util.Iterator ratings)
ratings
- the tested user's iter of ItemRatingprotected void testCachedRatings(java.util.Iterator ratings, TestStats testStats)
ratings
- the tested user's ItemRatingtestStats
- place to put test resultspublic void testRatings(java.util.Iterator iter)
iter
- Iterator of all ItemRatings in the test set, grouped by
UserID.public void testRecommendations2(java.util.Iterator iter1)
|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |