GClasses

GClasses::GNonlinearPCA Class Reference

This class trains a neural network to fit to the ratings. Although the name implies that it is an extension of PCA, I think it is better described as a non-linear generalization of matrix factorization. This algorithm was published in Scholz, M. Kaplan, F. Guy, C. L. Kopka, J. Selbig, J., Non-linear PCA: a missing data approach, In Bioinformatics, Vol. 21, Number 20, pp. 3887-3895, Oxford University Press, 2005. More...

#include <GRecommender.h>

Inheritance diagram for GClasses::GNonlinearPCA:
GClasses::GCollaborativeFilter

List of all members.

Public Member Functions

 GNonlinearPCA (size_t intrinsicDims, GRand &rand)
 General-purpose constructor.
 GNonlinearPCA (GDomNode *pNode, GLearnerLoader &ll)
 Deserialization constructor.
virtual ~GNonlinearPCA ()
 Destructor.
GNeuralNetmodel ()
 Returns a pointer to the neural net that is used to model the recommendation space. You may want to use this method to add hidden layers, set the learning rate, or change activation functions before the model is trained.
GMatrixusers ()
 Returns a pointer to the matrix of user preference vectors.
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 GDomNodeserialize (GDom *pDoc)
 See the comment for GCollaborativeFilter::serialize.
void noInputBias ()
 Specify to use no bias value with the inputs.
void noThreePass ()
 Specify not to use three-pass training. (It will just use one pass instead.)

Static Public Member Functions

static void test ()
 Performs unit tests. Throws if a failure occurs. Returns if successful.

Protected Member Functions

double validate (GNeuralNet *pNN, GMatrix &data)
 Returns the sum-squared error for the specified set of ratings.

Protected Attributes

size_t m_intrinsicDims
size_t m_items
double * m_pMins
double * m_pMaxs
GNeuralNetm_pModel
GMatrixm_pUsers
bool m_useInputBias
bool m_useThreePass

Detailed Description

This class trains a neural network to fit to the ratings. Although the name implies that it is an extension of PCA, I think it is better described as a non-linear generalization of matrix factorization. This algorithm was published in Scholz, M. Kaplan, F. Guy, C. L. Kopka, J. Selbig, J., Non-linear PCA: a missing data approach, In Bioinformatics, Vol. 21, Number 20, pp. 3887-3895, Oxford University Press, 2005.


Constructor & Destructor Documentation

GClasses::GNonlinearPCA::GNonlinearPCA ( size_t  intrinsicDims,
GRand rand 
)

General-purpose constructor.

GClasses::GNonlinearPCA::GNonlinearPCA ( GDomNode pNode,
GLearnerLoader ll 
)

Deserialization constructor.

virtual GClasses::GNonlinearPCA::~GNonlinearPCA ( ) [virtual]

Destructor.


Member Function Documentation

virtual void GClasses::GNonlinearPCA::impute ( double *  pVec,
size_t  dims 
) [virtual]
GNeuralNet* GClasses::GNonlinearPCA::model ( ) [inline]

Returns a pointer to the neural net that is used to model the recommendation space. You may want to use this method to add hidden layers, set the learning rate, or change activation functions before the model is trained.

void GClasses::GNonlinearPCA::noInputBias ( ) [inline]

Specify to use no bias value with the inputs.

void GClasses::GNonlinearPCA::noThreePass ( ) [inline]

Specify not to use three-pass training. (It will just use one pass instead.)

virtual double GClasses::GNonlinearPCA::predict ( size_t  user,
size_t  item 
) [virtual]
virtual GDomNode* GClasses::GNonlinearPCA::serialize ( GDom pDoc) [virtual]
static void GClasses::GNonlinearPCA::test ( ) [static]

Performs unit tests. Throws if a failure occurs. Returns if successful.

virtual void GClasses::GNonlinearPCA::train ( GMatrix data) [virtual]
GMatrix* GClasses::GNonlinearPCA::users ( ) [inline]

Returns a pointer to the matrix of user preference vectors.

double GClasses::GNonlinearPCA::validate ( GNeuralNet pNN,
GMatrix data 
) [protected]

Returns the sum-squared error for the specified set of ratings.


Member Data Documentation

double* GClasses::GNonlinearPCA::m_pMaxs [protected]
double* GClasses::GNonlinearPCA::m_pMins [protected]