Plots
shaded_mean_std(data, abscissa=None, num_std=1.0, mean_color='dodgerblue', shade_color='lightblue', title=None, xlabel=None, ylabel=None, ax=None, **kwargs)
¶
The usual mean \(\pm\) std deviation plot to aggregate runs of experiments.
PARAMETER | DESCRIPTION |
---|---|
data |
axis 0 is to be aggregated on (e.g. runs) and axis 1 is the data for each run.
TYPE:
|
abscissa |
values for the x-axis. Leave empty to use increasing integers. |
num_std |
number of standard deviations to shade around the mean.
TYPE:
|
mean_color |
color for the mean |
shade_color |
color for the shaded region |
title |
Title text. To use mathematics, use LaTeX notation. |
xlabel |
Text for the horizontal axis. |
ylabel |
Text for the vertical axis |
ax |
If passed, axes object into which to insert the figure. Otherwise, a new figure is created and returned
TYPE:
|
kwargs |
these are forwarded to the ax.plot() call for the mean.
DEFAULT:
|
RETURNS | DESCRIPTION |
---|---|
Axes
|
The axes used (or created) |
Source code in src/pydvl/reporting/plots.py
spearman_correlation(vv, num_values, pvalue)
¶
Simple matrix plots with spearman correlation for each pair in vv.
PARAMETER | DESCRIPTION |
---|---|
vv |
list of OrderedDicts with index: value. Spearman correlation is computed for the keys.
TYPE:
|
num_values |
Use only these many values from the data (from the start of the OrderedDicts)
TYPE:
|
pvalue |
correlation coefficients for which the p-value is below the
threshold
TYPE:
|
Source code in src/pydvl/reporting/plots.py
plot_shapley(df, *, level=0.05, ax=None, title=None, xlabel=None, ylabel=None)
¶
Plots the shapley values, as returned from compute_shapley_values, with error bars corresponding to an \(\alpha\)-level confidence interval.
PARAMETER | DESCRIPTION |
---|---|
df |
dataframe with the shapley values
TYPE:
|
level |
confidence level for the error bars
TYPE:
|
ax |
axes to plot on or None if a new subplots should be created
TYPE:
|
title |
string, title of the plot |
xlabel |
string, x label of the plot |
ylabel |
string, y label of the plot |
RETURNS | DESCRIPTION |
---|---|
Axes
|
The axes created or used |
Source code in src/pydvl/reporting/plots.py
plot_influence_distribution_by_label(influences, labels, title_extra='')
¶
Plots the histogram of the influence that all samples in the training set have over a single sample index, separated by labels.
PARAMETER | DESCRIPTION |
---|---|
influences |
array of influences (training samples x test samples) |
labels |
labels for the training set. |
title_extra |
TYPE:
|
Source code in src/pydvl/reporting/plots.py
Created: 2023-09-02