GClasses
|
This class makes recommendations by finding the nearest-neighbors (as determined by evaluating only overlapping ratings), and assuming that the ratings of these neighbors will be predictive of your ratings. More...
#include <GRecommender.h>
Public Member Functions | |
GInstanceRecommender (size_t neighbors, GRand &rand) | |
GInstanceRecommender (GDomNode *pNode, GLearnerLoader &ll) | |
virtual | ~GInstanceRecommender () |
void | setMetric (GSparseSimilarity *pMetric, bool own) |
Sets the similarity metric to use. if own is true, then this object will take care of deleting it as appropriate. | |
GSparseSimilarity * | metric () |
Returns the current similarity metric. (This might be useful, for example, if you want to modify the regularization value.) | |
virtual void | train (GMatrix &data) |
See the comment for GCollaborativeFilter::train. | |
virtual double | predict (size_t user, size_t item) |
See the comment for GCollaborativeFilter::predict. | |
virtual void | impute (double *pVec, size_t dims) |
See the comment for GCollaborativeFilter::impute. | |
virtual GDomNode * | serialize (GDom *pDoc) |
See the comment for GCollaborativeFilter::serialize. | |
Static Public Member Functions | |
static void | test () |
Performs unit tests. Throws if a failure occurs. Returns if successful. | |
Protected Attributes | |
size_t | m_neighbors |
GSparseSimilarity * | m_pMetric |
bool | m_ownMetric |
GSparseMatrix * | m_pData |
GBaselineRecommender * | m_pBaseline |
This class makes recommendations by finding the nearest-neighbors (as determined by evaluating only overlapping ratings), and assuming that the ratings of these neighbors will be predictive of your ratings.
GClasses::GInstanceRecommender::GInstanceRecommender | ( | size_t | neighbors, |
GRand & | rand | ||
) |
GClasses::GInstanceRecommender::GInstanceRecommender | ( | GDomNode * | pNode, |
GLearnerLoader & | ll | ||
) |
virtual GClasses::GInstanceRecommender::~GInstanceRecommender | ( | ) | [virtual] |
virtual void GClasses::GInstanceRecommender::impute | ( | double * | pVec, |
size_t | dims | ||
) | [virtual] |
See the comment for GCollaborativeFilter::impute.
Implements GClasses::GCollaborativeFilter.
GSparseSimilarity* GClasses::GInstanceRecommender::metric | ( | ) | [inline] |
Returns the current similarity metric. (This might be useful, for example, if you want to modify the regularization value.)
virtual double GClasses::GInstanceRecommender::predict | ( | size_t | user, |
size_t | item | ||
) | [virtual] |
See the comment for GCollaborativeFilter::predict.
Implements GClasses::GCollaborativeFilter.
See the comment for GCollaborativeFilter::serialize.
Implements GClasses::GCollaborativeFilter.
void GClasses::GInstanceRecommender::setMetric | ( | GSparseSimilarity * | pMetric, |
bool | own | ||
) |
Sets the similarity metric to use. if own is true, then this object will take care of deleting it as appropriate.
static void GClasses::GInstanceRecommender::test | ( | ) | [static] |
Performs unit tests. Throws if a failure occurs. Returns if successful.
virtual void GClasses::GInstanceRecommender::train | ( | GMatrix & | data | ) | [virtual] |
See the comment for GCollaborativeFilter::train.
Implements GClasses::GCollaborativeFilter.
size_t GClasses::GInstanceRecommender::m_neighbors [protected] |
bool GClasses::GInstanceRecommender::m_ownMetric [protected] |
GSparseMatrix* GClasses::GInstanceRecommender::m_pData [protected] |