Class CfnEndpointConfig.ClarifyInferenceConfigProperty
The inference configuration parameter for the model container.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.Sagemaker
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnEndpointConfig.ClarifyInferenceConfigProperty : CfnEndpointConfig.IClarifyInferenceConfigProperty
Syntax (vb)
Public Class CfnEndpointConfig.ClarifyInferenceConfigProperty Implements CfnEndpointConfig.IClarifyInferenceConfigProperty
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Sagemaker;
var clarifyInferenceConfigProperty = new ClarifyInferenceConfigProperty {
ContentTemplate = "contentTemplate",
FeatureHeaders = new [] { "featureHeaders" },
FeaturesAttribute = "featuresAttribute",
FeatureTypes = new [] { "featureTypes" },
LabelAttribute = "labelAttribute",
LabelHeaders = new [] { "labelHeaders" },
LabelIndex = 123,
MaxPayloadInMb = 123,
MaxRecordCount = 123,
ProbabilityAttribute = "probabilityAttribute",
ProbabilityIndex = 123
};
Synopsis
Constructors
| ClarifyInferenceConfigProperty() | The inference configuration parameter for the model container. |
Properties
| ContentTemplate | A template string used to format a JSON record into an acceptable model container input. |
| FeatureHeaders | The names of the features. |
| FeatureTypes | A list of data types of the features (optional). |
| FeaturesAttribute | Provides the JMESPath expression to extract the features from a model container input in JSON Lines format. |
| LabelAttribute | A JMESPath expression used to locate the list of label headers in the model container output. |
| LabelHeaders | For multiclass classification problems, the label headers are the names of the classes. |
| LabelIndex | A zero-based index used to extract a label header or list of label headers from model container output in CSV format. |
| MaxPayloadInMb | The maximum payload size (MB) allowed of a request from the explainer to the model container. |
| MaxRecordCount | The maximum number of records in a request that the model container can process when querying the model container for the predictions of a synthetic dataset . A record is a unit of input data that inference can be made on, for example, a single line in CSV data. If |
| ProbabilityAttribute | A JMESPath expression used to extract the probability (or score) from the model container output if the model container is in JSON Lines format. |
| ProbabilityIndex | A zero-based index used to extract a probability value (score) or list from model container output in CSV format. |
Constructors
ClarifyInferenceConfigProperty()
The inference configuration parameter for the model container.
public ClarifyInferenceConfigProperty()
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Sagemaker;
var clarifyInferenceConfigProperty = new ClarifyInferenceConfigProperty {
ContentTemplate = "contentTemplate",
FeatureHeaders = new [] { "featureHeaders" },
FeaturesAttribute = "featuresAttribute",
FeatureTypes = new [] { "featureTypes" },
LabelAttribute = "labelAttribute",
LabelHeaders = new [] { "labelHeaders" },
LabelIndex = 123,
MaxPayloadInMb = 123,
MaxRecordCount = 123,
ProbabilityAttribute = "probabilityAttribute",
ProbabilityIndex = 123
};
Properties
ContentTemplate
A template string used to format a JSON record into an acceptable model container input.
public string? ContentTemplate { get; set; }
Property Value
Remarks
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.
FeatureHeaders
The names of the features.
public string[]? FeatureHeaders { get; set; }
Property Value
string[]
Remarks
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.
FeatureTypes
A list of data types of the features (optional).
public string[]? FeatureTypes { get; set; }
Property Value
string[]
Remarks
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.
FeaturesAttribute
Provides the JMESPath expression to extract the features from a model container input in JSON Lines format.
public string? FeaturesAttribute { get; set; }
Property Value
Remarks
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]}' .
LabelAttribute
A JMESPath expression used to locate the list of label headers in the model container output.
public string? LabelAttribute { get; set; }
Property Value
Remarks
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"]
LabelHeaders
For multiclass classification problems, the label headers are the names of the classes.
public string[]? LabelHeaders { get; set; }
Property Value
string[]
Remarks
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.
LabelIndex
A zero-based index used to extract a label header or list of label headers from model container output in CSV format.
public double? LabelIndex { get; set; }
Property Value
Remarks
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'] .
MaxPayloadInMb
The maximum payload size (MB) allowed of a request from the explainer to the model container.
public double? MaxPayloadInMb { get; set; }
Property Value
Remarks
MaxRecordCount
The maximum number of records in a request that the model container can process when querying the model container for the predictions of a synthetic dataset . A record is a unit of input data that inference can be made on, for example, a single line in CSV data. If MaxRecordCount is 1 , the model container expects one record per request. A value of 2 or greater means that the model expects batch requests, which can reduce overhead and speed up the inferencing process. If this parameter is not provided, the explainer will tune the record count per request according to the model container's capacity at runtime.
public double? MaxRecordCount { get; set; }
Property Value
Remarks
ProbabilityAttribute
A JMESPath expression used to extract the probability (or score) from the model container output if the model container is in JSON Lines format.
public string? ProbabilityAttribute { get; set; }
Property Value
Remarks
Example : If the model container output of a single request is '{"predicted_label":1,"probability":0.6}' , then set ProbabilityAttribute to 'probability' .
ProbabilityIndex
A zero-based index used to extract a probability value (score) or list from model container output in CSV format.
public double? ProbabilityIndex { get; set; }
Property Value
Remarks
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] .