candle.uq_utils.split_data_for_empirical_calibration

candle.uq_utils.split_data_for_empirical_calibration#

candle.uq_utils.split_data_for_empirical_calibration(Ytrue, Ypred, sigma, cal_split=0.8)#

Extracts a portion of the arrays provided for the computation of the calibration and reserves the remainder portion for testing.

Parameters:
  • Ytrue (numpy array) – Array with true (observed) values

  • Ypred (numpy array) – Array with predicted values.

  • sigma (numpy array) – Array with standard deviations learned with deep learning model (or std value computed from prediction if homoscedastic inference).

  • cal_split (float) – Split of data to use for estimating the calibration relationship. It is assumet that it will be a value in (0, 1). (Default: use 80% of predictions to generate empirical calibration).

Returns:

Tuple of numpy arrays

  • index_perm_total (numpy array): Random permutation of the array indices. The first ‘num_cal’ of the indices correspond to the samples that are used for calibration, while the remainder are the samples reserved for calibration testing.

  • pSigma_cal (numpy array): Part of the input sigma array to use for calibration.

  • pSigma_test (numpy array): Part of the input sigma array to reserve for testing.

  • pPred_cal (numpy array): Part of the input Ypred array to use for calibration.

  • pPred_test (numpy array): Part of the input Ypred array to reserve for testing.

  • true_cal (numpy array): Part of the input Ytrue array to use for calibration.

  • true_test (numpy array): Part of the input Ytrue array to reserve for testing.