CFEngine API

org.recommender.algorithms.Experimental
Class ContinuousBayesNetAlgorithm

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

public class ContinuousBayesNetAlgorithm
extends java.lang.Object
implements CFAlgorithm

Describes an implementation of the CFAlgorithm interface to make CF predictions using a Bayesian network.


Field Summary
(package private)  ContinuousBayesNet model
           
 
Constructor Summary
ContinuousBayesNetAlgorithm(DataManager mgr)
           
 
Method Summary
 long getAveragePredictionTime()
          Very useful to get the prediction time after a bunch of experiment Should be implemented within each algorithm class.
 ItemRating[] getRecommendations(int activeUser, int n)
          Return top n recommendations for the active user.
 ItemRating[] getRecommendationsByType(int activeUser, int n, int type)
          Added by Yun Wang Return top n recommendations for the active user of specific type.
 ItemPrediction predictRating(int activeUser, int item)
          predicts the rating for the given user and item.
 java.lang.String toString()
          Return the name of algorithm.
 void updateUser(int userID)
          Notify algorithm that the given user's ratings have changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

model

ContinuousBayesNet model
Constructor Detail

ContinuousBayesNetAlgorithm

public ContinuousBayesNetAlgorithm(DataManager mgr)
Method Detail

getRecommendations

public ItemRating[] getRecommendations(int activeUser,
                                       int n)
                                throws java.sql.SQLException,
                                       CFNotImplementedException
Description copied from interface: CFAlgorithm
Return top n recommendations for the active user. Note: Returned array contains only recommendations for non-rated items. All recommendations must be valid. If there is an insufficient number of recommendations to fulfill the requested amount, return a filled array of size equal to the number of valid recommendations. All recommendations' predicted values must comply to same guidelines set forth by predictRating() in CFAlgorithm.

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

getRecommendationsByType

public ItemRating[] getRecommendationsByType(int activeUser,
                                             int n,
                                             int type)
                                      throws java.sql.SQLException,
                                             CFNotImplementedException
Description copied from interface: CFAlgorithm
Added by Yun Wang Return top n recommendations for the active user of specific type. Note: Returned array contains only recommendations for non-rated items. All recommendations must be valid. If there is an insufficient number of recommendations to fulfill the requested amount, return a filled array of size equal to the number of valid recommendations. All recommendations' predicted values must comply to same guidelines set forth by predictRating() in CFAlgorithm.

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

predictRating

public ItemPrediction predictRating(int activeUser,
                                    int item)
                             throws CFNotImplementedException
predicts the rating for the given user and item.

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

updateUser

public void updateUser(int userID)
                throws CFNotImplementedException
Description copied from interface: CFAlgorithm
Notify algorithm that the given user's ratings have changed.

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

getAveragePredictionTime

public long getAveragePredictionTime()
                              throws CFNotImplementedException
Description copied from interface: CFAlgorithm
Very useful to get the prediction time after a bunch of experiment Should be implemented within each algorithm class.

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

toString

public java.lang.String toString()
Description copied from interface: CFAlgorithm
Return the name of algorithm.

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

CFEngine API

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