candle.uq_utils.compute_statistics_homoscedastic#
- candle.uq_utils.compute_statistics_homoscedastic(df_data, col_true=4, col_pred_start=6)#
Extracts ground truth, mean prediction, error and standard deviation of prediction from inference data frame. The latter includes all the individual inference realizations.
- Parameters:
df_data (pandas dataframe) – Data frame generated by current CANDLE inference experiments. Indices are hard coded to agree with current CANDLE version. (The inference file usually has the name: <model>.predicted_INFER.tsv).
col_true (int) – Index of the column in the data frame where the true value is stored (Default: 4, index in current HOM format).
col_pred_start (int) – Index of the column in the data frame where the first predicted value is stored. All the predicted values during inference are stored (Default: 6 index, in current HOM format).
- Returns:
Tuple of numpy arrays
Ytrue (numpy array): Array with true (observed) values
Ypred_mean (numpy array): Array with predicted values (mean of predictions).
yerror (numpy array): Array with errors computed (observed - predicted).
sigma (numpy array): Array with standard deviations learned with deep learning model. For homoscedastic inference this corresponds to the std value computed from prediction (and is equal to the following returned variable).
Ypred_std (numpy array): Array with standard deviations computed from regular (homoscedastic) inference.
pred_name (string): Name of data colum or quantity predicted (as extracted from the data frame using the col_true index).