You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Microsoft.ML.Data/Transforms/FeatureContributionCalculationTransform.cs
+23-2Lines changed: 23 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -25,10 +25,29 @@
25
25
namespaceMicrosoft.ML.Data
26
26
{
27
27
/// <summary>
28
-
/// The FeatureContributionCalculationTransformer computes model-specific contribution scores for each feature.
28
+
/// The FeatureContributionCalculationTransformer computes model-specific per-feature contributions to the score of each data point.
29
29
/// See the list of currently supported models below.
30
30
/// </summary>
31
31
/// <remarks>
32
+
/// <para>
33
+
/// Scorind a data set with a trained model produces a score, or prediction, for each data sample. To understand and explain these predictions
34
+
/// it can be useful to inspect which features influenced them most significantly. FeatureContributionCalculationTransformer computes a model-specific
35
+
/// list of per-feature contributions to the score for each data sample. These contributions can be positive (they make the score higher) or negative
36
+
/// (they make the score lower).
37
+
/// </para>
38
+
/// <para>
39
+
/// For linear models, the contribution of a given feature is just equal to the product of feature times the corresponding weight. Similarly, for
40
+
/// Generalized Additive Models (GAM), the contrubution of a feature is equal to the shape function for the given feature evaluated at the feature value.
41
+
/// </para>
42
+
/// <para>
43
+
/// For tree based models, the contribution of a feature is equal to the change in score produced by exploring the opposite sub-tree every time a decision
44
+
/// node for the given feature is encountered. Consider a simple case with a singe decision tree that has a decision node for the binary feature F1.
45
+
/// Given a data sample that has feature F1 equal to true, we can calculate the score it would have obtained if we chose the subtree corresponding to
46
+
/// the feature F1 being equal to false while keeping the other features constant. The contribution of feature F1 for the given sample is the difference
47
+
/// between the original score and the score obtained by taking the opposite decision at the node corresponding to feature F1. This algorithm extendes
48
+
/// naturally to models with many decision trees.
49
+
/// </para>
50
+
/// <para>
32
51
/// Feature Contribution Calculation is currently supported for the following models:
0 commit comments