BackgroundSummary<T>

Models & Types · AiDotNet.Interpretability.Helpers

Represents summarized background data for interpretability methods.

For Beginners

This class holds the summarized background data along with weights for each sample.

The weights indicate how “representative” each sample is:

  • Higher weight = represents more of the original data
  • Weights sum to 1.0

Example: If cluster A had 1000 samples and cluster B had 100 samples, the center of cluster A would have ~10x the weight of cluster B.

Constructors

Constructor Summary
BackgroundSummary(Matrix<T> data, Vector<T> weights) Initializes a new background summary.

Properties

Property Summary
Matrix<T> Data { get; } Gets the summarized background data (rows = samples).
Vector<T> Weights { get; } Gets the weight for each background sample.
int NumFeatures { get; } Gets the number of features.
int NumSamples { get; } Gets the number of background samples.

Methods

Method Summary
Vector<T> GetExpectedPrediction(Func<Vector<T>, Vector<T>> predictFunction) Gets the expected prediction using the background data.
Vector<T> GetWeightedMean() Gets the weighted mean of each feature.
string ToString() Returns a human-readable summary.