holisticai.bias.plots.statistical_parity_plot#
- holisticai.bias.plots.statistical_parity_plot(p_attr, y_pred, pos_label=1, compare_to=None, ax=None, size=None, title=None)[source]#
Statistical Parity Plot (Binary Classification).
Description
This function plots the statistical parity for each group along with acceptable bounds. We take the group with maximum success rate as the comparison group.
Parameters
- p_attrarray-like
Protected attribute vector
- y_predarray-like
Prediction vector (binary)
- pos_label (optional)label, default=1
The positive label
- compare_to (optional)str or int
The group we are comparing to
- 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