InterpretabilityMetricsHelper<T>

Helpers & Utilities · AiDotNet.Interpretability

Provides static utility methods for computing interpretability and fairness metrics.

For Beginners

This is a collection of reusable helper methods for fairness and bias analysis.

These methods handle common tasks like:

  • Identifying unique groups in data (e.g., different age groups, genders)
  • Computing metrics like positive rates, true positive rates, etc.
  • Extracting subsets of data for specific groups

By centralizing these methods here, we avoid code duplication and ensure consistent calculations across all bias detection and fairness evaluation tools.

Methods

Method Summary
List<T> GetUniqueGroups(Vector<T> sensitiveFeature) Identifies all unique groups in the sensitive feature.
List<int> GetGroupIndices(Vector<T> sensitiveFeature, T groupValue) Gets the indices of all samples belonging to a specific group.
T ComputeFalsePositiveRate(Vector<T> predictions, Vector<T> actualLabels) Computes the False Positive Rate (FPR).
T ComputePositiveRate(Vector<T> predictions) Computes the positive prediction rate (proportion of positive predictions).
T ComputePrecision(Vector<T> predictions, Vector<T> actualLabels) Computes the Precision (Positive Predictive Value).
T ComputeTruePositiveRate(Vector<T> predictions, Vector<T> actualLabels) Computes the True Positive Rate (TPR) or Recall.
Vector<T> GetSubset(Vector<T> vector, List<int> indices) Extracts a subset of a vector based on specified indices.