athena.utils.average_rrmse

average_rrmse(hyperparams, best, csv, verbose=False, resample=5)[source]

Objective function to be optimized during the tuning process of the method tune_pr_matrix(). The optimal hyperparameters of the spectral distribution are searched for in a domain logarithmically scaled in base 10. For each call of average_rrmse() by the optimizer, the same hyperparameter is tested in two nested procedures: in the external procedure the projection matrix is resampled a number of times specified by the resample parameter; in the internal procedure the relative root mean squared error (rrmse()) is evaluated as the k-fold mean of a k-fold cross-validation procedure. The score of a single fold of this cross-validation procedure is the rrmse on the validation set of the predictions of the response surface built with a Subspace object on the training set.

Parameters
  • hyperparameters (list) – logarithm of the parameter of the spectral distribution passed to average_rrmse by the optimizer.

  • csv ('CrossValidation') – CrossValidation object which contains the same Subspace object and the inputs, outputs, gradients datasets. The

  • best (list) – list that records the best score and the best projection matrix. The initial values are 0.8 and a n_features-by-input_dim numpy.ndarray of zeros.

  • resample (int) – number of times the projection matrix is resampled from the same spectral distribution with the same hyperparameter.

  • verbose (bool) – True to print the score for each resample.

Returns

minumum of the scores evaluated for the same hyperparameter and a specified number of resamples of the projection matrix.

Return type

numpy.float64