CfnInferenceExperimentPropsMixin
- class aws_cdk.mixins_preview.aws_sagemaker.mixins.CfnInferenceExperimentPropsMixin(props, *, strategy=None)
Bases:
MixinCreates an inference experiment using the configurations specified in the request.
Use this API to setup and schedule an experiment to compare model variants on a Amazon SageMaker inference endpoint. For more information about inference experiments, see Shadow tests .
Amazon SageMaker begins your experiment at the scheduled time and routes traffic to your endpoint’s model variants based on your specified configuration.
While the experiment is in progress or after it has concluded, you can view metrics that compare your model variants. For more information, see View, monitor, and edit shadow tests .
- See:
- CloudformationResource:
AWS::SageMaker::InferenceExperiment
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins cfn_inference_experiment_props_mixin = sagemaker_mixins.CfnInferenceExperimentPropsMixin(sagemaker_mixins.CfnInferenceExperimentMixinProps( data_storage_config=sagemaker_mixins.CfnInferenceExperimentPropsMixin.DataStorageConfigProperty( content_type=sagemaker_mixins.CfnInferenceExperimentPropsMixin.CaptureContentTypeHeaderProperty( csv_content_types=["csvContentTypes"], json_content_types=["jsonContentTypes"] ), destination="destination", kms_key="kmsKey" ), description="description", desired_state="desiredState", endpoint_name="endpointName", kms_key="kmsKey", model_variants=[sagemaker_mixins.CfnInferenceExperimentPropsMixin.ModelVariantConfigProperty( infrastructure_config=sagemaker_mixins.CfnInferenceExperimentPropsMixin.ModelInfrastructureConfigProperty( infrastructure_type="infrastructureType", real_time_inference_config=sagemaker_mixins.CfnInferenceExperimentPropsMixin.RealTimeInferenceConfigProperty( instance_count=123, instance_type="instanceType" ) ), model_name="modelName", variant_name="variantName" )], name="name", role_arn="roleArn", schedule=sagemaker_mixins.CfnInferenceExperimentPropsMixin.InferenceExperimentScheduleProperty( end_time="endTime", start_time="startTime" ), shadow_mode_config=sagemaker_mixins.CfnInferenceExperimentPropsMixin.ShadowModeConfigProperty( shadow_model_variants=[sagemaker_mixins.CfnInferenceExperimentPropsMixin.ShadowModelVariantConfigProperty( sampling_percentage=123, shadow_model_variant_name="shadowModelVariantName" )], source_model_variant_name="sourceModelVariantName" ), status_reason="statusReason", tags=[CfnTag( key="key", value="value" )], type="type" ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::SageMaker::InferenceExperiment.- Parameters:
props (
Union[CfnInferenceExperimentMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['dataStorageConfig', 'description', 'desiredState', 'endpointName', 'kmsKey', 'modelVariants', 'name', 'roleArn', 'schedule', 'shadowModeConfig', 'statusReason', 'tags', 'type']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
CaptureContentTypeHeaderProperty
- class CfnInferenceExperimentPropsMixin.CaptureContentTypeHeaderProperty(*, csv_content_types=None, json_content_types=None)
Bases:
objectConfiguration specifying how to treat different headers.
If no headers are specified Amazon SageMaker AI will by default base64 encode when capturing the data.
- Parameters:
csv_content_types (
Optional[Sequence[str]]) – The list of all content type headers that Amazon SageMaker AI will treat as CSV and capture accordingly.json_content_types (
Optional[Sequence[str]]) – The list of all content type headers that SageMaker AI will treat as JSON and capture accordingly.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins capture_content_type_header_property = sagemaker_mixins.CfnInferenceExperimentPropsMixin.CaptureContentTypeHeaderProperty( csv_content_types=["csvContentTypes"], json_content_types=["jsonContentTypes"] )
Attributes
- csv_content_types
The list of all content type headers that Amazon SageMaker AI will treat as CSV and capture accordingly.
- json_content_types
The list of all content type headers that SageMaker AI will treat as JSON and capture accordingly.
DataStorageConfigProperty
- class CfnInferenceExperimentPropsMixin.DataStorageConfigProperty(*, content_type=None, destination=None, kms_key=None)
Bases:
objectThe Amazon S3 location and configuration for storing inference request and response data.
This is an optional parameter that you can use for data capture. For more information, see Capture data .
- Parameters:
content_type (
Union[IResolvable,CaptureContentTypeHeaderProperty,Dict[str,Any],None]) – Configuration specifying how to treat different headers. If no headers are specified SageMaker will by default base64 encode when capturing the data.destination (
Optional[str]) – The Amazon S3 bucket where the inference request and response data is stored.kms_key (
Optional[str]) – The AWS Key Management Service key that Amazon SageMaker uses to encrypt captured data at rest using Amazon S3 server-side encryption.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins data_storage_config_property = sagemaker_mixins.CfnInferenceExperimentPropsMixin.DataStorageConfigProperty( content_type=sagemaker_mixins.CfnInferenceExperimentPropsMixin.CaptureContentTypeHeaderProperty( csv_content_types=["csvContentTypes"], json_content_types=["jsonContentTypes"] ), destination="destination", kms_key="kmsKey" )
Attributes
- content_type
Configuration specifying how to treat different headers.
If no headers are specified SageMaker will by default base64 encode when capturing the data.
- destination
The Amazon S3 bucket where the inference request and response data is stored.
- kms_key
The AWS Key Management Service key that Amazon SageMaker uses to encrypt captured data at rest using Amazon S3 server-side encryption.
EndpointMetadataProperty
- class CfnInferenceExperimentPropsMixin.EndpointMetadataProperty(*, endpoint_config_name=None, endpoint_name=None, endpoint_status=None)
Bases:
objectThe metadata of the endpoint.
- Parameters:
endpoint_config_name (
Optional[str]) – The name of the endpoint configuration.endpoint_name (
Optional[str]) – The name of the endpoint.endpoint_status (
Optional[str]) – The status of the endpoint. For possible values of the status of an endpoint, see ` <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-endpointmetadata.html#cfn-sagemaker-inferenceexperiment-endpointmetadata-endpointstatus>`_ .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins endpoint_metadata_property = sagemaker_mixins.CfnInferenceExperimentPropsMixin.EndpointMetadataProperty( endpoint_config_name="endpointConfigName", endpoint_name="endpointName", endpoint_status="endpointStatus" )
Attributes
- endpoint_config_name
The name of the endpoint configuration.
- endpoint_name
The name of the endpoint.
- endpoint_status
The status of the endpoint.
For possible values of the status of an endpoint, see ` <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-endpointmetadata.html#cfn-sagemaker-inferenceexperiment-endpointmetadata-endpointstatus>`_ .
InferenceExperimentScheduleProperty
- class CfnInferenceExperimentPropsMixin.InferenceExperimentScheduleProperty(*, end_time=None, start_time=None)
Bases:
objectThe start and end times of an inference experiment.
The maximum duration that you can set for an inference experiment is 30 days.
- Parameters:
end_time (
Optional[str]) – The timestamp at which the inference experiment ended or will end.start_time (
Optional[str]) – The timestamp at which the inference experiment started or will start.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins inference_experiment_schedule_property = sagemaker_mixins.CfnInferenceExperimentPropsMixin.InferenceExperimentScheduleProperty( end_time="endTime", start_time="startTime" )
Attributes
- end_time
The timestamp at which the inference experiment ended or will end.
- start_time
The timestamp at which the inference experiment started or will start.
ModelInfrastructureConfigProperty
- class CfnInferenceExperimentPropsMixin.ModelInfrastructureConfigProperty(*, infrastructure_type=None, real_time_inference_config=None)
Bases:
objectThe configuration for the infrastructure that the model will be deployed to.
- Parameters:
infrastructure_type (
Optional[str]) – The inference option to which to deploy your model. Possible values are the following:. -RealTime: Deploy to real-time inference.real_time_inference_config (
Union[IResolvable,RealTimeInferenceConfigProperty,Dict[str,Any],None]) – The infrastructure configuration for deploying the model to real-time inference.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins model_infrastructure_config_property = sagemaker_mixins.CfnInferenceExperimentPropsMixin.ModelInfrastructureConfigProperty( infrastructure_type="infrastructureType", real_time_inference_config=sagemaker_mixins.CfnInferenceExperimentPropsMixin.RealTimeInferenceConfigProperty( instance_count=123, instance_type="instanceType" ) )
Attributes
- infrastructure_type
.
RealTime: Deploy to real-time inference.
- See:
- Type:
The inference option to which to deploy your model. Possible values are the following
- real_time_inference_config
The infrastructure configuration for deploying the model to real-time inference.
ModelVariantConfigProperty
- class CfnInferenceExperimentPropsMixin.ModelVariantConfigProperty(*, infrastructure_config=None, model_name=None, variant_name=None)
Bases:
objectContains information about the deployment options of a model.
- Parameters:
infrastructure_config (
Union[IResolvable,ModelInfrastructureConfigProperty,Dict[str,Any],None]) – The configuration for the infrastructure that the model will be deployed to.model_name (
Optional[str]) – The name of the Amazon SageMaker Model entity.variant_name (
Optional[str]) – The name of the variant.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins model_variant_config_property = sagemaker_mixins.CfnInferenceExperimentPropsMixin.ModelVariantConfigProperty( infrastructure_config=sagemaker_mixins.CfnInferenceExperimentPropsMixin.ModelInfrastructureConfigProperty( infrastructure_type="infrastructureType", real_time_inference_config=sagemaker_mixins.CfnInferenceExperimentPropsMixin.RealTimeInferenceConfigProperty( instance_count=123, instance_type="instanceType" ) ), model_name="modelName", variant_name="variantName" )
Attributes
- infrastructure_config
The configuration for the infrastructure that the model will be deployed to.
- model_name
The name of the Amazon SageMaker Model entity.
RealTimeInferenceConfigProperty
- class CfnInferenceExperimentPropsMixin.RealTimeInferenceConfigProperty(*, instance_count=None, instance_type=None)
Bases:
objectThe infrastructure configuration for deploying the model to a real-time inference endpoint.
- Parameters:
instance_count (
Union[int,float,None]) – The number of instances of the type specified byInstanceType.instance_type (
Optional[str]) – The instance type the model is deployed to.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins real_time_inference_config_property = sagemaker_mixins.CfnInferenceExperimentPropsMixin.RealTimeInferenceConfigProperty( instance_count=123, instance_type="instanceType" )
Attributes
- instance_count
The number of instances of the type specified by
InstanceType.
- instance_type
The instance type the model is deployed to.
ShadowModeConfigProperty
- class CfnInferenceExperimentPropsMixin.ShadowModeConfigProperty(*, shadow_model_variants=None, source_model_variant_name=None)
Bases:
objectThe configuration of
ShadowModeinference experiment type, which specifies a production variant to take all the inference requests, and a shadow variant to which Amazon SageMaker replicates a percentage of the inference requests.For the shadow variant it also specifies the percentage of requests that Amazon SageMaker replicates.
- Parameters:
shadow_model_variants (
Union[IResolvable,Sequence[Union[IResolvable,ShadowModelVariantConfigProperty,Dict[str,Any]]],None]) – List of shadow variant configurations.source_model_variant_name (
Optional[str]) – The name of the production variant, which takes all the inference requests.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins shadow_mode_config_property = sagemaker_mixins.CfnInferenceExperimentPropsMixin.ShadowModeConfigProperty( shadow_model_variants=[sagemaker_mixins.CfnInferenceExperimentPropsMixin.ShadowModelVariantConfigProperty( sampling_percentage=123, shadow_model_variant_name="shadowModelVariantName" )], source_model_variant_name="sourceModelVariantName" )
Attributes
- shadow_model_variants
List of shadow variant configurations.
- source_model_variant_name
The name of the production variant, which takes all the inference requests.
ShadowModelVariantConfigProperty
- class CfnInferenceExperimentPropsMixin.ShadowModelVariantConfigProperty(*, sampling_percentage=None, shadow_model_variant_name=None)
Bases:
objectThe name and sampling percentage of a shadow variant.
- Parameters:
sampling_percentage (
Union[int,float,None]) – The percentage of inference requests that Amazon SageMaker replicates from the production variant to the shadow variant.shadow_model_variant_name (
Optional[str]) – The name of the shadow variant.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins shadow_model_variant_config_property = sagemaker_mixins.CfnInferenceExperimentPropsMixin.ShadowModelVariantConfigProperty( sampling_percentage=123, shadow_model_variant_name="shadowModelVariantName" )
Attributes
- sampling_percentage
The percentage of inference requests that Amazon SageMaker replicates from the production variant to the shadow variant.
- shadow_model_variant_name
The name of the shadow variant.