mednet.engine.classify.saliency.utils¶
Common utilities for saliency generation and analysis tasks.
Functions
|
Extract all meaningful statistics from a reconciled statistics set. |
|
Build an histogram of values. |
|
Plot histograms for a particular variable, across all datasets. |
|
Summarize results obtained by interpretability or completeness analysis in a table. |
- mednet.engine.classify.saliency.utils.extract_statistics(data, index)[source]¶
Extract all meaningful statistics from a reconciled statistics set.
- Parameters:
- Return type:
- Returns:
A dictionary containing the following elements:
values
: A list of values corresponding to the index on the datamean
: The mean of the value listdirstdev
: The standard deviation of the value listquartiles
: The 25%, 50% (median), and 75% quartile of valuesdecreasing_scores
: A list of sample names and labels in decreasing value.
- mednet.engine.classify.saliency.utils.make_table(results, indexes, format_)[source]¶
Summarize results obtained by interpretability or completeness analysis in a table.
- Parameters:
- Return type:
- Returns:
A table, formatted following
format_
and containing the various quartile informations for each split and metric.
- mednet.engine.classify.saliency.utils.make_histogram(name, values, xlim=None, title=None)[source]¶
Build an histogram of values.
- Parameters:
name (
str
) – Name of the variable to be histogrammed (will appear in the figure).values (
ndarray
[tuple
[int
,...
],dtype
[TypeVar
(_ScalarType_co
, bound=generic
, covariant=True)]]) – Values to be histogrammed.xlim (
tuple
[float
,float
] |None
) – A tuple representing the X-axis maximum and minimum to plot. If not set, then use the bin boundaries.
- Return type:
- Returns:
A matplotlib figure containing the histogram.