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

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/ml_v1/classes.rb,
lib/google/apis/ml_v1/representations.rb,
lib/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.



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

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



1097
1098
1099
# File 'lib/google/apis/ml_v1/classes.rb', line 1097

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



1104
1105
1106
# File 'lib/google/apis/ml_v1/classes.rb', line 1104

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



1112
1113
1114
# File 'lib/google/apis/ml_v1/classes.rb', line 1112

def xrai_attribution
  @xrai_attribution
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1119
1120
1121
1122
1123
# File 'lib/google/apis/ml_v1/classes.rb', line 1119

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