Table of Contents

Class DisparateImpactBiasDetector<T>

Namespace
AiDotNet.Interpretability
Assembly
AiDotNet.dll

Detects bias using the Disparate Impact metric (80% rule). Disparate Impact Ratio = (Min Positive Rate) / (Max Positive Rate). A ratio below 0.8 indicates potential bias.

public class DisparateImpactBiasDetector<T> : BiasDetectorBase<T>, IBiasDetector<T>

Type Parameters

T

The numeric type for calculations.

Inheritance
DisparateImpactBiasDetector<T>
Implements
Inherited Members

Constructors

DisparateImpactBiasDetector(double)

Initializes a new instance of the DisparateImpactBiasDetector class.

public DisparateImpactBiasDetector(double threshold = 0.8)

Parameters

threshold double

The threshold for detecting bias (default is 0.8, representing the 80% rule from fair lending guidelines).

Methods

GetBiasDetectionResult(Vector<T>, Vector<T>, Vector<T>?)

Implements bias detection using Disparate Impact ratio (80% rule).

protected override BiasDetectionResult<T> GetBiasDetectionResult(Vector<T> predictions, Vector<T> sensitiveFeature, Vector<T>? actualLabels)

Parameters

predictions Vector<T>
sensitiveFeature Vector<T>
actualLabels Vector<T>

Returns

BiasDetectionResult<T>