GClasses
|
This class always predicts the average rating for each item, no matter to whom it is making the recommendation. The purpose of this algorithm is to serve as a baseline for comparison. More...
#include <GRecommender.h>
Public Member Functions | |
GBaselineRecommender (GRand &rand) | |
General-purpose constructor. | |
GBaselineRecommender (GDomNode *pNode, GLearnerLoader &ll) | |
Deserialization constructor. | |
virtual | ~GBaselineRecommender () |
Destructor. | |
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 | |
double * | m_pRatings |
size_t | m_items |
This class always predicts the average rating for each item, no matter to whom it is making the recommendation. The purpose of this algorithm is to serve as a baseline for comparison.
GClasses::GBaselineRecommender::GBaselineRecommender | ( | GRand & | rand | ) |
General-purpose constructor.
GClasses::GBaselineRecommender::GBaselineRecommender | ( | GDomNode * | pNode, |
GLearnerLoader & | ll | ||
) |
Deserialization constructor.
virtual GClasses::GBaselineRecommender::~GBaselineRecommender | ( | ) | [virtual] |
Destructor.
virtual void GClasses::GBaselineRecommender::impute | ( | double * | pVec, |
size_t | dims | ||
) | [virtual] |
See the comment for GCollaborativeFilter::impute.
Implements GClasses::GCollaborativeFilter.
virtual double GClasses::GBaselineRecommender::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.
static void GClasses::GBaselineRecommender::test | ( | ) | [static] |
Performs unit tests. Throws if a failure occurs. Returns if successful.
virtual void GClasses::GBaselineRecommender::train | ( | GMatrix & | data | ) | [virtual] |
See the comment for GCollaborativeFilter::train.
Implements GClasses::GCollaborativeFilter.
size_t GClasses::GBaselineRecommender::m_items [protected] |
double* GClasses::GBaselineRecommender::m_pRatings [protected] |