Table of Contents

Class DemographicParityBiasDetector<T>

Namespace
AiDotNet.Interpretability
Assembly
AiDotNet.dll

Detects bias using Demographic Parity (Statistical Parity Difference). Measures the difference in positive prediction rates between groups. A difference greater than 0.1 (10%) indicates potential bias.

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

Type Parameters

T

The numeric type for calculations.

Inheritance
DemographicParityBiasDetector<T>
Implements
Inherited Members

Constructors

DemographicParityBiasDetector(double)

Initializes a new instance of the DemographicParityBiasDetector class.

public DemographicParityBiasDetector(double threshold = 0.1)

Parameters

threshold double

The threshold for detecting bias (default is 0.1, representing 10% difference threshold).

Methods

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

Implements bias detection using Statistical Parity Difference.

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>