ClarifyInferenceConfigProperty Struct
The inference configuration parameter for the model container.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_sagemaker as sagemaker } from 'aws-cdk-lib';
const clarifyInferenceConfigProperty: sagemaker.CfnEndpointConfig.ClarifyInferenceConfigProperty = {
contentTemplate: 'contentTemplate',
featureHeaders: ['featureHeaders'],
featuresAttribute: 'featuresAttribute',
featureTypes: ['featureTypes'],
labelAttribute: 'labelAttribute',
labelHeaders: ['labelHeaders'],
labelIndex: 123,
maxPayloadInMb: 123,
maxRecordCount: 123,
probabilityAttribute: 'probabilityAttribute',
probabilityIndex: 123,
};
Properties
contentTemplateoptionalstringcontent_templateoptionalstrcontentTemplateoptionalStringContentTemplateoptionalstringContentTemplateoptional*string#For example, a ContentTemplate string '{"myfeatures":$features}' will format a list of features [1,2,3] into the record string '{"myfeatures":[1,2,3]}' . Required only when the model container input is in JSON Lines format.
featureHeadersoptionalstring[]feature_headersoptionaltyping.List[str]featureHeadersoptionalList<String>FeatureHeadersoptionalstring[]FeatureHeadersoptional*[]*string#notes
If provided, these are included in the endpoint response payload to help readability of the InvokeEndpoint output. See the Response section under Invoke the endpoint in the Developer Guide for more information.
featuresAttributeoptionalstringfeatures_attributeoptionalstrfeaturesAttributeoptionalStringFeaturesAttributeoptionalstringFeaturesAttributeoptional*string#For example, if FeaturesAttribute is the JMESPath expression 'myfeatures' , it extracts a list of features [1,2,3] from request data '{"myfeatures":[1,2,3]}' .
featureTypesoptionalstring[]feature_typesoptionaltyping.List[str]featureTypesoptionalList<String>FeatureTypesoptionalstring[]FeatureTypesoptional*[]*string#notes
Applicable only to NLP explainability. If provided, FeatureTypes must have at least one 'text' string (for example, ['text'] ). If FeatureTypes is not provided, the explainer infers the feature types based on the baseline data. The feature types are included in the endpoint response payload. For additional information see the response section under Invoke the endpoint in the Developer Guide for more information.
labelAttributeoptionalstringlabel_attributeoptionalstrlabelAttributeoptionalStringLabelAttributeoptionalstringLabelAttributeoptional*string#Example : If the model container output of a batch request is '{"labels":["cat","dog","fish"],"probability":[0.6,0.3,0.1]}' , then set LabelAttribute to 'labels' to extract the list of label headers ["cat","dog","fish"]
labelHeadersoptionalstring[]label_headersoptionaltyping.List[str]labelHeadersoptionalList<String>LabelHeadersoptionalstring[]LabelHeadersoptional*[]*string#notes
Otherwise, the label header is the name of the predicted label. These are used to help readability for the output of the InvokeEndpoint API. See the response section under Invoke the endpoint in the Developer Guide for more information. If there are no label headers in the model container output, provide them manually using this parameter.
labelIndexoptionalnumberlabel_indexoptionalint | floatlabelIndexoptionalNumberLabelIndexoptionaldoubleLabelIndexoptional*float64#notes
Example for a multiclass model: If the model container output consists of label headers followed by probabilities: '"[\'cat\',\'dog\',\'fish\']","[0.1,0.6,0.3]"' , set LabelIndex to 0 to select the label headers ['cat','dog','fish'] .
maxPayloadInMboptionalnumbermax_payload_in_mboptionalint | floatmaxPayloadInMboptionalNumberMaxPayloadInMboptionaldoubleMaxPayloadInMboptional*float64#Defaults to 6 MB.
maxRecordCountoptionalnumbermax_record_countoptionalint | floatmaxRecordCountoptionalNumberMaxRecordCountoptionaldoubleMaxRecordCountoptional*float64#probabilityAttributeoptionalstringprobability_attributeoptionalstrprobabilityAttributeoptionalStringProbabilityAttributeoptionalstringProbabilityAttributeoptional*string#Example : If the model container output of a single request is '{"predicted_label":1,"probability":0.6}' , then set ProbabilityAttribute to 'probability' .
probabilityIndexoptionalnumberprobability_indexoptionalint | floatprobabilityIndexoptionalNumberProbabilityIndexoptionaldoubleProbabilityIndexoptional*float64#notes
If this value is not provided, the entire model container output will be treated as a probability value (score) or list.
Example for a single class model: If the model container output consists of a string-formatted prediction label followed by its probability: '1,0.6' , set ProbabilityIndex to 1 to select the probability value 0.6 .
Example for a multiclass model: If the model container output consists of a string-formatted prediction label followed by its probability: '"[\'cat\',\'dog\',\'fish\']","[0.1,0.6,0.3]"' , set ProbabilityIndex to 1 to select the probability values [0.1,0.6,0.3] .