PPCKO: Principal Predictive Components for Estimating an Autoregressive Operator
 
Loading...
Searching...
No Matches
KO_Factory< solver, k_imp, valid_err_ret, cv_strat, cv_err_eval > Class Template Reference

Generating the PPCKO solver runtime according to an input string. More...

#include <Factory_ko.hpp>

Static Public Member Functions

static std::unique_ptr< PPC_KO_wrapper< solver, k_imp, valid_err_ret, cv_strat, cv_err_eval > > KO_solver (const std::string &id, KO_Traits::StoringMatrix &&X, double alpha, int k, double threshold_ppc, const std::vector< double > &alphas, const std::vector< int > &k_s, double toll, int min_size_ts, int max_size_ts, int num_threads)
 Static method that takes a string as identifier and builds a pointer to the right object for the cross-validation requested.
 

Detailed Description

template<SOLVER solver, K_IMP k_imp, VALID_ERR_RET valid_err_ret, CV_STRAT cv_strat, CV_ERR_EVAL cv_err_eval>
class KO_Factory< solver, k_imp, valid_err_ret, cv_strat, cv_err_eval >

Generating the PPCKO solver runtime according to an input string.

Template Parameters
solverif algorithm solved inverting the regularized covariance or avoiding it through gep (not possible if retaining the number of PPCs with explanatory power criterion)
k_impif k is imposed or has to be found through explanatory power criterion
valid_err_retif validation error are stored
cv_stratstrategy for splitting training/validation sets
err_evalhow to evaluate the loss between prediction on validation set and validation set

Member Function Documentation

◆ KO_solver()

template<SOLVER solver, K_IMP k_imp, VALID_ERR_RET valid_err_ret, CV_STRAT cv_strat, CV_ERR_EVAL cv_err_eval>
static std::unique_ptr< PPC_KO_wrapper< solver, k_imp, valid_err_ret, cv_strat, cv_err_eval > > KO_Factory< solver, k_imp, valid_err_ret, cv_strat, cv_err_eval >::KO_solver ( const std::string & id,
KO_Traits::StoringMatrix && X,
double alpha,
int k,
double threshold_ppc,
const std::vector< double > & alphas,
const std::vector< int > & k_s,
double toll,
int min_size_ts,
int max_size_ts,
int num_threads )
inlinestatic

Static method that takes a string as identifier and builds a pointer to the right object for the cross-validation requested.

Generating the PPCKO solver runtime according to an input string. It raises an error if a wrong one is passed

Parameters
idinput string:
  • 'NoCV': no cross-validation is performed. Regularization is imposed. Number of PPCs can be imposed or retrieved through explanatory power criterion;
  • 'CV_alpha': cross-validation for regularization parameter. Number of PPCs can be imposed or retrieved through explanatory power criterion;
  • 'CV_k': cross-validation for number of retained PPCs. Regularization parameter is imposed;
  • 'CV': cross-validation for both regularization parameter and number of retained PPCs.
Xmatrix containing the fts
alpharegularization parameter
knumber of retained PPCs:
  • 'k' = 0: if possible (no cv on ok), number of retained PPCs is selected through explanatory power criterion;
  • 'k' > 0: if possible (no cv on ok), number of retained PPCs is imposed.
threshold_ppcrequested explanatory power from the PPCs. Used only for selecting 'k' through explanatory power criterion
alphasinput space for regularization parameter
k_sinput space for the number of retained PPCs
tollthe cv on the number of retained PPCs continues only if between two parameters, that are checked in increasing order, the absolute difference between two validation errors is bigger than tolerance*trace(covariance). If not, stops and look for k only between the tested ones
min_size_tssmallest training set size (number of time instants)
max_size_tsbiggest training set size (number of time instants)
num_threadsnumber of threads for OMP
Returns
a unique pointer to a PPC_KO_wrapper<solver,k_imp,valid_err_ret,cv_strat,cv_err_eval>

the method is static. std::unique_ptr provides a safer architecture for factory purposes


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