plot
plot_predictionintervals(y_train, y_train_pred, y_train_pred_low, y_train_pred_high, y_test, y_test_pred, y_test_pred_low, y_test_pred_high, suptitle, figsize=(10, 10))
¶
Plots prediction intervals for training and testing data. This function generates four subplots arranged in a 2x2 grid: 1. True vs predicted values with error bars representing prediction intervals. 2. Prediction interval width vs true values. 3. Ordered prediction interval widths for both training and testing data. 4. Histograms of the interval widths for training and testing data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
y_train |
array - like
|
True values for the training set. |
required |
y_train_pred |
array - like
|
Predicted values for the training set. |
required |
y_train_pred_low |
array - like
|
Lower bounds of prediction intervals for the training set. |
required |
y_train_pred_high |
array - like
|
Upper bounds of prediction intervals for the training set. |
required |
y_test |
array - like
|
True values for the testing set. |
required |
y_test_pred |
array - like
|
Predicted values for the testing set. |
required |
y_test_pred_low |
array - like
|
Lower bounds of prediction intervals for the testing set. |
required |
y_test_pred_high |
array - like
|
Upper bounds of prediction intervals for the testing set. |
required |
suptitle |
str
|
The title for the entire figure. |
required |
figsize |
tuple
|
Size of the figure. Default is (10, 10). |
(10, 10)
|
Returns:
Name | Type | Description |
---|---|---|
None |
None
|
The function displays the plots but does not return any value. |
Source code in spotpython/uc/plot.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
|