Class ClarifyInferenceConfig
- All Implemented Interfaces:
Serializable
,SdkPojo
,ToCopyableBuilder<ClarifyInferenceConfig.Builder,
ClarifyInferenceConfig>
The inference configuration parameter for the model container.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
final String
A template string used to format a JSON record into an acceptable model container input.final boolean
final boolean
equalsBySdkFields
(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.The names of the features.final String
Provides the JMESPath expression to extract the features from a model container input in JSON Lines format.final List
<ClarifyFeatureType> A list of data types of the features (optional).A list of data types of the features (optional).final <T> Optional
<T> getValueForField
(String fieldName, Class<T> clazz) final boolean
For responses, this returns true if the service returned a value for the FeatureHeaders property.final boolean
For responses, this returns true if the service returned a value for the FeatureTypes property.final int
hashCode()
final boolean
For responses, this returns true if the service returned a value for the LabelHeaders property.final String
A JMESPath expression used to locate the list of label headers in the model container output.For multiclass classification problems, the label headers are the names of the classes.final Integer
A zero-based index used to extract a label header or list of label headers from model container output in CSV format.final Integer
The maximum payload size (MB) allowed of a request from the explainer to the model container.final Integer
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.final String
A JMESPath expression used to extract the probability (or score) from the model container output if the model container is in JSON Lines format.final Integer
A zero-based index used to extract a probability value (score) or list from model container output in CSV format.static Class
<? extends ClarifyInferenceConfig.Builder> Take this object and create a builder that contains all of the current property values of this object.final String
toString()
Returns a string representation of this object.Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
featuresAttribute
Provides the JMESPath expression to extract the features from a model container input in JSON Lines format. 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]}'
.- Returns:
- Provides the JMESPath expression to extract the features from a model container input in JSON Lines
format. 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]}'
.
-
contentTemplate
A template string used to format a JSON record into an acceptable model container input. 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.- Returns:
- A template string used to format a JSON record into an acceptable model container input. 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.
-
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
is1
, 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.- Returns:
- 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
is1
, 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.
-
maxPayloadInMB
The maximum payload size (MB) allowed of a request from the explainer to the model container. Defaults to
6
MB.- Returns:
- The maximum payload size (MB) allowed of a request from the explainer to the model container. Defaults to
6
MB.
-
probabilityIndex
A zero-based index used to extract a probability value (score) or list from model container output in CSV format. 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'
, setProbabilityIndex
to1
to select the probability value0.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]"'
, setProbabilityIndex
to1
to select the probability values[0.1,0.6,0.3]
.- Returns:
- A zero-based index used to extract a probability value (score) or list from model container output in CSV
format. 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'
, setProbabilityIndex
to1
to select the probability value0.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]"'
, setProbabilityIndex
to1
to select the probability values[0.1,0.6,0.3]
.
-
labelIndex
A zero-based index used to extract a label header or list of label headers from model container output in CSV format.
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]"'
, setLabelIndex
to0
to select the label headers['cat','dog','fish']
.- Returns:
- A zero-based index used to extract a label header or list of label headers from model container output in
CSV format.
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]"'
, setLabelIndex
to0
to select the label headers['cat','dog','fish']
.
-
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.
Example: If the model container output of a single request is
'{"predicted_label":1,"probability":0.6}'
, then setProbabilityAttribute
to'probability'
.- Returns:
- A JMESPath expression used to extract the probability (or score) from the model container output if the
model container is in JSON Lines format.
Example: If the model container output of a single request is
'{"predicted_label":1,"probability":0.6}'
, then setProbabilityAttribute
to'probability'
.
-
labelAttribute
A JMESPath expression used to locate the list of label headers in the model container output.
Example: If the model container output of a batch request is
'{"labels":["cat","dog","fish"],"probability":[0.6,0.3,0.1]}'
, then setLabelAttribute
to'labels'
to extract the list of label headers["cat","dog","fish"]
- Returns:
- A JMESPath expression used to locate the list of label headers in the model container output.
Example: If the model container output of a batch request is
'{"labels":["cat","dog","fish"],"probability":[0.6,0.3,0.1]}'
, then setLabelAttribute
to'labels'
to extract the list of label headers["cat","dog","fish"]
-
hasLabelHeaders
public final boolean hasLabelHeaders()For responses, this returns true if the service returned a value for the LabelHeaders property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
labelHeaders
For multiclass classification problems, the label headers are the names of the classes. 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.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasLabelHeaders()
method.- Returns:
- For multiclass classification problems, the label headers are the names of the classes. 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.
-
hasFeatureHeaders
public final boolean hasFeatureHeaders()For responses, this returns true if the service returned a value for the FeatureHeaders property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
featureHeaders
The names of the features. 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.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasFeatureHeaders()
method.- Returns:
- The names of the features. 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). Applicable only to NLP explainability. If provided,
FeatureTypes
must have at least one'text'
string (for example,['text']
). IfFeatureTypes
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.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasFeatureTypes()
method.- Returns:
- A list of data types of the features (optional). Applicable only to NLP explainability. If provided,
FeatureTypes
must have at least one'text'
string (for example,['text']
). IfFeatureTypes
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.
-
hasFeatureTypes
public final boolean hasFeatureTypes()For responses, this returns true if the service returned a value for the FeatureTypes property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
featureTypesAsStrings
A list of data types of the features (optional). Applicable only to NLP explainability. If provided,
FeatureTypes
must have at least one'text'
string (for example,['text']
). IfFeatureTypes
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.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasFeatureTypes()
method.- Returns:
- A list of data types of the features (optional). Applicable only to NLP explainability. If provided,
FeatureTypes
must have at least one'text'
string (for example,['text']
). IfFeatureTypes
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.
-
toBuilder
Description copied from interface:ToCopyableBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToCopyableBuilder<ClarifyInferenceConfig.Builder,
ClarifyInferenceConfig> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
-
equals
-
equalsBySdkFields
Description copied from interface:SdkPojo
Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojo
class, and is generated based on a service model.If an
SdkPojo
class does not have any inherited fields,equalsBySdkFields
andequals
are essentially the same.- Specified by:
equalsBySdkFields
in interfaceSdkPojo
- Parameters:
obj
- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
toString
-
getValueForField
-
sdkFields
-