holisticai.bias.plots.disparate_impact_plot#
- holisticai.bias.plots.disparate_impact_plot(p_attr, y_pred, pos_label=1, compare_to=None, ax=None, size=None, title=None)[source]#
Disparate Impact Plot (Binary Classification).
Description
This function plots the disparate impact for each group along with acceptable bounds. We take the group with maximum success rate as the ‘majority group’.
Parameters
- p_attrarray-like
Protected attribute vector
- y_predarray-like
Prediction vector
- pos_labellabel, 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