mdn_predplot
compare_distributions_mdn(trainer, x_instance, y_actual=None, num_samples=10000, ax=None, dtype=np.float32)
Compare the actual and predicted outcome value/distributions for the MDN model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
trainer |
MDNTrainer
|
The trained MDNTrainer instance. |
required |
x_instance |
np.ndarray or torch.Tensor
|
The instance for which to predict the outcome distribution. |
required |
y_actual |
float or np.ndarray
|
The actual outcome(s). If a single value, plot as a vertical line. If an array or list, plot as a KDE. If None, don't plot actual outcome. |
None
|
num_samples |
int
|
The number of samples to generate from the predicted and actual distributions. Default is 10000. |
10000
|
ax |
matplotlib.axes.Axes
|
The axes on which to plot. If None, create a new figure. |
None
|
dtype |
np.dtype
|
Data type to use for plotting. Default is np.float32. |
np.float32
|
Returns:
Type | Description |
---|---|
None |
Source code in uncertaintyplayground/predplot/mdn_predplot.py
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 |
|