holisticai.bias.plots.frequency_matrix_plot#
- holisticai.bias.plots.frequency_matrix_plot(p_attr, y_pred, groups=None, classes=None, normalize=None, reverse_colors=False, ax=None, size=None, title=None)[source]#
Frequency Matrix Plot.
Description
This function plots the matrix of occurence rate (count) for each group, class pair. We include the option to normalise over groups or classes.
Parameters
- p_attrarray-like
Protected attribute vector
- y_predarray-like
Prediction vector (categorical)
- groups (optional)array or list
The groups in order
- classes (optional)array or list
The classes in order
- normalize (optional): None, ‘group’ or ‘class’
According to which of group or class we normalize
- reverse_colors (optional): bool, default=False
Option to reverse the color palette
- ax (optional)matplotlib axes
Pre-existing axes for the plot
- size (optional)(int, int)
Size of the figure
- title (optional)str
Title of the figure
Returns
matplotlib ax