Class: Google::Apis::MlV1::GoogleCloudMlV1ExplanationConfig

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/ml_v1/classes.rb,
generated/google/apis/ml_v1/representations.rb,
generated/google/apis/ml_v1/representations.rb

Overview

Message holding configuration options for explaining model predictions. There are three feature attribution methods supported for TensorFlow models: integrated gradients, sampled Shapley, and XRAI. Learn more about feature attributions.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudMlV1ExplanationConfig

Returns a new instance of GoogleCloudMlV1ExplanationConfig.



1116
1117
1118
# File 'generated/google/apis/ml_v1/classes.rb', line 1116

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#integrated_gradients_attributionGoogle::Apis::MlV1::GoogleCloudMlV1IntegratedGradientsAttribution

Attributes credit by computing the Aumann-Shapley value taking advantage of the model's fully differentiable structure. Refer to this paper for more details: https://arxiv.org/abs/1703.01365 Corresponds to the JSON property integratedGradientsAttribution



1099
1100
1101
# File 'generated/google/apis/ml_v1/classes.rb', line 1099

def integrated_gradients_attribution
  @integrated_gradients_attribution
end

#sampled_shapley_attributionGoogle::Apis::MlV1::GoogleCloudMlV1SampledShapleyAttribution

An attribution method that approximates Shapley values for features that contribute to the label being predicted. A sampling strategy is used to approximate the value rather than considering all subsets of features. Corresponds to the JSON property sampledShapleyAttribution



1106
1107
1108
# File 'generated/google/apis/ml_v1/classes.rb', line 1106

def sampled_shapley_attribution
  @sampled_shapley_attribution
end

#xrai_attributionGoogle::Apis::MlV1::GoogleCloudMlV1XraiAttribution

Attributes credit by computing the XRAI taking advantage of the model's fully differentiable structure. Refer to this paper for more details: https://arxiv. org/abs/1906.02825 Currently only implemented for models with natural image inputs. Corresponds to the JSON property xraiAttribution



1114
1115
1116
# File 'generated/google/apis/ml_v1/classes.rb', line 1114

def xrai_attribution
  @xrai_attribution
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1121
1122
1123
1124
1125
# File 'generated/google/apis/ml_v1/classes.rb', line 1121

def update!(**args)
  @integrated_gradients_attribution = args[:integrated_gradients_attribution] if args.key?(:integrated_gradients_attribution)
  @sampled_shapley_attribution = args[:sampled_shapley_attribution] if args.key?(:sampled_shapley_attribution)
  @xrai_attribution = args[:xrai_attribution] if args.key?(:xrai_attribution)
end