CFEngine API

org.recommender.algorithms.Experimental
Class SimpleSVD

java.lang.Object
  |
  +--org.recommender.algorithms.Experimental.SimpleSVD
All Implemented Interfaces:
CFAlgorithm

public class SimpleSVD
extends java.lang.Object
implements CFAlgorithm

Describes an implementation of the CFAlgorithm interface to make CF predictions using the Simple SVD method. This is just an experimentally testing algorithm, and only the predictRating method is implemented. Some parameters are hard-coded. If you want to test this algorithm yourself, please change the parameters accordingly. Default paramters: number of users: 943 number of items: 1682 number of training ratings: 80000 number of test ratings: 20000

Author:
Shuzhen Nong

Field Summary
(package private)  float[][] result
           
 
Constructor Summary
SimpleSVD(DataManager mgr)
          Constructor, simply assigns DataManager.
 
Method Summary
 long getAveragePredictionTime()
          Not implemented
 ItemPrediction[] getRecommendations(int activeUser, int n)
          Not implemented
 ItemPrediction[] getRecommendationsByType(int activeUser, int n, int type)
          Not implemented
 ItemPrediction predictRating(int activeUser, int item)
          Simply return the rating in the SVD-reduced matrix
 void SimpleSVDOperation()
          Construct the SVD-reduced matrix
 java.lang.String toString()
          return the name of this algorithm
 void updateUser(int userID)
          Not implemented
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

result

float[][] result
Constructor Detail

SimpleSVD

public SimpleSVD(DataManager mgr)
Constructor, simply assigns DataManager.

Parameters:
mgr -
Method Detail

getRecommendationsByType

public ItemPrediction[] getRecommendationsByType(int activeUser,
                                                 int n,
                                                 int type)
                                          throws java.sql.SQLException,
                                                 CFNotImplementedException
Not implemented

Specified by:
getRecommendationsByType in interface CFAlgorithm
Parameters:
activeUser -
n -
type -
Returns:
itemPredList
Throws:
java.sql.SQLException
CFNotImplementedException

getRecommendations

public ItemPrediction[] getRecommendations(int activeUser,
                                           int n)
                                    throws java.sql.SQLException,
                                           CFNotImplementedException
Not implemented

Specified by:
getRecommendations in interface CFAlgorithm
Parameters:
activeUser -
n -
Returns:
itemPredList
Throws:
java.sql.SQLException
CFNotImplementedException

predictRating

public ItemPrediction predictRating(int activeUser,
                                    int item)
                             throws CFNotImplementedException
Simply return the rating in the SVD-reduced matrix

Specified by:
predictRating in interface CFAlgorithm
Parameters:
activeUser -
item -
Returns:
predictedRating
CFNotImplementedException

updateUser

public void updateUser(int userID)
                throws CFNotImplementedException
Not implemented

Specified by:
updateUser in interface CFAlgorithm
Parameters:
userID -
CFNotImplementedException

getAveragePredictionTime

public long getAveragePredictionTime()
                              throws CFNotImplementedException
Not implemented

Specified by:
getAveragePredictionTime in interface CFAlgorithm
Returns:
average prediction time
CFNotImplementedException

toString

public java.lang.String toString()
return the name of this algorithm

Specified by:
toString in interface CFAlgorithm
Overrides:
toString in class java.lang.Object
Returns:
String

SimpleSVDOperation

public void SimpleSVDOperation()
Construct the SVD-reduced matrix


CFEngine API

Copyright © 2003 - Oregon State University www.orst.edu