src.plot.receptive_fields_distribution_plot
Classes
|
- class src.plot.receptive_fields_distribution_plot.ReceptiveFieldsDistributionPlot(**kwargs)
- Author:
Alberto M. Esmoris Pena
Class to plot the distribution of predicted or expected value in the receptive fields. See
ReceptiveFieldsDistributionPlot.- Variables:
y_rf (
np.ndarray) – The expected value for each point for each receptive field.yhat_rf (
np.ndarray) – The predicted value for each point for each receptive field.class_names (list) – The names representing each class.
- __init__(**kwargs)
Initialize a MplPlot.
- Parameters:
kwargs – The attributes for the MplPlot.
- plot(**kwargs)
Plot the distribution of predicted and/or expected values.
See
plot.Plot.plot().
- count(y)
Compute the absolute frequency and the count of receptive fields containing at least one class case.
- Parameters:
y (
np.ndarrayor list) – Either the predicted or the expected values for each receptive field. In other words, y[i] is the i receptive field such that y[i][j] is the value corresponding to the point j in the receptive field i.- Returns:
The absolute frequency considering all points and the count of how many receptive fields do contain at least one element of a given class. If a and b are the returned vectors, a[i] is the absolute frequency of class i and b[i] is the number of receptive fields that contain at least one point of class i.
- Return type:
tuple
- plot_counts(x, fig, count, rf_count, axes=None, count_title=None, rf_count_title=None, subplot_offset=0, nrows=1, ncols=2)
Do the plots corresponding to a set of counts. There are two potential sets of counts, the one corresponding to predictions, and the one corresponding to expected values.
- Parameters:
x (
np.ndarray) – The values for the x-axis of the plots.fig (
mpl.figure.Figure) – The matplotlib figure where the plots belong to.count (
np.ndarray) – How many cases among all receptive fields. In other words, count[i] is the number of cases corresponding to class i.rf_count (
np.ndarray) – How many receptive fields contain at least one case for each class. In other words, rf_count[i] is the number of receptive fields that contain at least one point of class i.axes (list) – List where the axes of the generated plots will be appended.
count_title – The title for the subplot corresponding to count.
rf_count_title – The title for the subplot corresponding to rf_count.
subplot_offset (int) – How many subplots skip before generating the new ones.
nrows (int) – How many rows of subplots.
- Type:
count_title: str
- Paran ncols:
How many columns of subplots.
- Returns:
Nothing at all, but the plots are made effective. If axes is not None, the corresponding axes are appended to the list.