mlpack  master
Public Member Functions | Private Attributes | List of all members
mlpack::amf::ValidationRMSETermination< MatType > Class Template Reference

This class implements validation termination policy based on RMSE index. More...

Public Member Functions

 ValidationRMSETermination (MatType &V, size_t num_test_points, double tolerance=1e-5, size_t maxIterations=10000, size_t reverseStepTolerance=3)
 Create a validation set according to given parameters and nullifies this set in data matrix(training set). More...
 
const double & Index () const
 Get current value of residue. More...
 
void Initialize (const MatType &)
 Initializes the termination policy before stating the factorization. More...
 
bool IsConverged (arma::mat &W, arma::mat &H)
 Check if termination criterio is met. More...
 
const size_t & Iteration () const
 Get current iteration count. More...
 
const size_t & MaxIterations () const
 Access upper limit of iteration count. More...
 
size_t & MaxIterations ()
 
const size_t & NumTestPoints () const
 Get number of validation points. More...
 
const double & Tolerance () const
 Access tolerance value. More...
 
double & Tolerance ()
 

Private Attributes

double c_index
 
double c_indexOld
 
arma::mat H
 
bool isCopy
 indicates whether a copy of information is available which corresponds to minimum residue point More...
 
size_t iteration
 current iteration count More...
 
size_t maxIterations
 max iteration limit More...
 
size_t num_test_points
 number of validation test points More...
 
size_t reverseStepCount
 successive residue drops More...
 
size_t reverseStepTolerance
 tolerance on successive residue drops More...
 
double rmse
 
double rmseOld
 rmse values More...
 
arma::mat test_points
 validation point matrix More...
 
double tolerance
 tolerance More...
 
arma::mat W
 variables to store information of minimum residue point More...
 

Detailed Description

template<class MatType>
class mlpack::amf::ValidationRMSETermination< MatType >

This class implements validation termination policy based on RMSE index.

The input data matrix is divided into 2 sets, training set and validation set. Entries of validation set are nullifed in the input matrix. Termination criterion is met when increase in validation set RMSe value drops below the given tolerance. To accommodate spikes certain number of successive validation RMSE drops are accepted. This upper imit on successive drops can be adjusted with reverseStepCount. Secondary termination criterion terminates algorithm when iteration count goes above the threshold.

Note
The input matrix is modified by this termination policy.
See also
AMF

Definition at line 37 of file validation_RMSE_termination.hpp.

Constructor & Destructor Documentation

template<class MatType >
mlpack::amf::ValidationRMSETermination< MatType >::ValidationRMSETermination ( MatType &  V,
size_t  num_test_points,
double  tolerance = 1e-5,
size_t  maxIterations = 10000,
size_t  reverseStepTolerance = 3 
)
inline

Create a validation set according to given parameters and nullifies this set in data matrix(training set).

Parameters
VInput matrix to be factorized.
num_test_pointsnumber of validation test points
maxIterationsmax iteration count before termination
reverseStepTolerancemax successive RMSE drops allowed

Definition at line 49 of file validation_RMSE_termination.hpp.

References mlpack::amf::ValidationRMSETermination< MatType >::num_test_points, and mlpack::amf::ValidationRMSETermination< MatType >::test_points.

Member Function Documentation

template<class MatType >
const double& mlpack::amf::ValidationRMSETermination< MatType >::Index ( ) const
inline

Get current value of residue.

Definition at line 187 of file validation_RMSE_termination.hpp.

References mlpack::amf::ValidationRMSETermination< MatType >::rmse.

template<class MatType >
void mlpack::amf::ValidationRMSETermination< MatType >::Initialize ( const MatType &  )
inline
template<class MatType >
bool mlpack::amf::ValidationRMSETermination< MatType >::IsConverged ( arma::mat &  W,
arma::mat &  H 
)
inline
template<class MatType >
const size_t& mlpack::amf::ValidationRMSETermination< MatType >::Iteration ( ) const
inline

Get current iteration count.

Definition at line 190 of file validation_RMSE_termination.hpp.

References mlpack::amf::ValidationRMSETermination< MatType >::iteration.

template<class MatType >
const size_t& mlpack::amf::ValidationRMSETermination< MatType >::MaxIterations ( ) const
inline

Access upper limit of iteration count.

Definition at line 196 of file validation_RMSE_termination.hpp.

References mlpack::amf::ValidationRMSETermination< MatType >::maxIterations.

template<class MatType >
size_t& mlpack::amf::ValidationRMSETermination< MatType >::MaxIterations ( )
inline
template<class MatType >
const size_t& mlpack::amf::ValidationRMSETermination< MatType >::NumTestPoints ( ) const
inline

Get number of validation points.

Definition at line 193 of file validation_RMSE_termination.hpp.

References mlpack::amf::ValidationRMSETermination< MatType >::num_test_points.

template<class MatType >
const double& mlpack::amf::ValidationRMSETermination< MatType >::Tolerance ( ) const
inline

Access tolerance value.

Definition at line 200 of file validation_RMSE_termination.hpp.

References mlpack::amf::ValidationRMSETermination< MatType >::tolerance.

template<class MatType >
double& mlpack::amf::ValidationRMSETermination< MatType >::Tolerance ( )
inline

Member Data Documentation

template<class MatType >
double mlpack::amf::ValidationRMSETermination< MatType >::c_index
private
template<class MatType >
double mlpack::amf::ValidationRMSETermination< MatType >::c_indexOld
private
template<class MatType >
arma::mat mlpack::amf::ValidationRMSETermination< MatType >::H
private
template<class MatType >
bool mlpack::amf::ValidationRMSETermination< MatType >::isCopy
private

indicates whether a copy of information is available which corresponds to minimum residue point

Definition at line 228 of file validation_RMSE_termination.hpp.

Referenced by mlpack::amf::ValidationRMSETermination< MatType >::Initialize(), and mlpack::amf::ValidationRMSETermination< MatType >::IsConverged().

template<class MatType >
size_t mlpack::amf::ValidationRMSETermination< MatType >::iteration
private
template<class MatType >
size_t mlpack::amf::ValidationRMSETermination< MatType >::maxIterations
private
template<class MatType >
size_t mlpack::amf::ValidationRMSETermination< MatType >::num_test_points
private
template<class MatType >
size_t mlpack::amf::ValidationRMSETermination< MatType >::reverseStepCount
private
template<class MatType >
size_t mlpack::amf::ValidationRMSETermination< MatType >::reverseStepTolerance
private

tolerance on successive residue drops

Definition at line 222 of file validation_RMSE_termination.hpp.

Referenced by mlpack::amf::ValidationRMSETermination< MatType >::IsConverged().

template<class MatType >
double mlpack::amf::ValidationRMSETermination< MatType >::rmse
private
template<class MatType >
double mlpack::amf::ValidationRMSETermination< MatType >::rmseOld
private
template<class MatType >
arma::mat mlpack::amf::ValidationRMSETermination< MatType >::test_points
private
template<class MatType >
double mlpack::amf::ValidationRMSETermination< MatType >::tolerance
private
template<class MatType >
arma::mat mlpack::amf::ValidationRMSETermination< MatType >::W
private

variables to store information of minimum residue point

Definition at line 231 of file validation_RMSE_termination.hpp.

Referenced by mlpack::amf::ValidationRMSETermination< MatType >::IsConverged().


The documentation for this class was generated from the following file: