Class: AWSCDK::Sagemaker::CfnEndpointConfig::ClarifyShapBaselineConfigProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
sagemaker/cfn_endpoint_config.rb

Overview

The configuration for the SHAP baseline (also called the background or reference dataset) of the Kernal SHAP algorithm.

  • The number of records in the baseline data determines the size of the synthetic dataset, which has an impact on latency of explainability requests. For more information, see the Synthetic data of Configure and create an endpoint .
  • ShapBaseline and ShapBaselineUri are mutually exclusive parameters. One or the either is required to configure a SHAP baseline.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mime_type: nil, shap_baseline: nil, shap_baseline_uri: nil) ⇒ ClarifyShapBaselineConfigProperty

Returns a new instance of ClarifyShapBaselineConfigProperty.

Parameters:

  • mime_type (String, nil) (defaults to: nil)

    The MIME type of the baseline data.

  • shap_baseline (String, nil) (defaults to: nil)

    The inline SHAP baseline data in string format.

  • shap_baseline_uri (String, nil) (defaults to: nil)

    The uniform resource identifier (URI) of the S3 bucket where the SHAP baseline file is stored.



1187
1188
1189
1190
1191
1192
1193
1194
# File 'sagemaker/cfn_endpoint_config.rb', line 1187

def initialize(mime_type: nil, shap_baseline: nil, shap_baseline_uri: nil)
  @mime_type = mime_type
  Jsii::Type.check_type(@mime_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "mimeType") unless @mime_type.nil?
  @shap_baseline = shap_baseline
  Jsii::Type.check_type(@shap_baseline, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "shapBaseline") unless @shap_baseline.nil?
  @shap_baseline_uri = shap_baseline_uri
  Jsii::Type.check_type(@shap_baseline_uri, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "shapBaselineUri") unless @shap_baseline_uri.nil?
end

Instance Attribute Details

#mime_typeString? (readonly)

The MIME type of the baseline data.

Choose from 'text/csv' or 'application/jsonlines' . Defaults to 'text/csv' .



1202
1203
1204
# File 'sagemaker/cfn_endpoint_config.rb', line 1202

def mime_type
  @mime_type
end

#shap_baselineString? (readonly)

The inline SHAP baseline data in string format.

ShapBaseline can have one or multiple records to be used as the baseline dataset. The format of the SHAP baseline file should be the same format as the training dataset. For example, if the training dataset is in CSV format and each record contains four features, and all features are numerical, then the format of the baseline data should also share these characteristics. For natural language processing (NLP) of text columns, the baseline value should be the value used to replace the unit of text specified by the Granularity of the TextConfig parameter. The size limit for ShapBasline is 4 KB. Use the ShapBaselineUri parameter if you want to provide more than 4 KB of baseline data.



1209
1210
1211
# File 'sagemaker/cfn_endpoint_config.rb', line 1209

def shap_baseline
  @shap_baseline
end

#shap_baseline_uriString? (readonly)

The uniform resource identifier (URI) of the S3 bucket where the SHAP baseline file is stored.

The format of the SHAP baseline file should be the same format as the format of the training dataset. For example, if the training dataset is in CSV format, and each record in the training dataset has four features, and all features are numerical, then the baseline file should also have this same format. Each record should contain only the features. If you are using a virtual private cloud (VPC), the ShapBaselineUri should be accessible to the VPC. For more information about setting up endpoints with Amazon Virtual Private Cloud, see Give SageMaker access to Resources in your Amazon Virtual Private Cloud .



1216
1217
1218
# File 'sagemaker/cfn_endpoint_config.rb', line 1216

def shap_baseline_uri
  @shap_baseline_uri
end

Class Method Details

.jsii_propertiesObject



1218
1219
1220
1221
1222
1223
1224
# File 'sagemaker/cfn_endpoint_config.rb', line 1218

def self.jsii_properties
  {
    :mime_type => "mimeType",
    :shap_baseline => "shapBaseline",
    :shap_baseline_uri => "shapBaselineUri",
  }
end

Instance Method Details

#to_jsiiObject



1226
1227
1228
1229
1230
1231
1232
1233
1234
# File 'sagemaker/cfn_endpoint_config.rb', line 1226

def to_jsii
  result = {}
  result.merge!({
    "mimeType" => @mime_type,
    "shapBaseline" => @shap_baseline,
    "shapBaselineUri" => @shap_baseline_uri,
  })
  result.compact
end