ModelConfig: Model Config

ModelConfigR Documentation

Model Config

Description

Config object related to a model and its endpoint to be created.

Public fields

predictor_config

Predictor dictionary of the analysis config

Methods

Public methods


Method new()

Initializes a configuration of a model and the endpoint to be created for it.

Usage
ModelConfig$new(
  model_name,
  instance_count,
  instance_type,
  accept_type = NULL,
  content_type = NULL,
  content_template = NULL,
  custom_attributes = NULL,
  accelerator_type = NULL,
  endpoint_name_prefix = NULL
)
Arguments
model_name

(str): Model name (as created by 'CreateModel').

instance_count

(int): The number of instances of a new endpoint for model inference.

instance_type

(str): The type of EC2 instance to use for model inference, for example, 'ml.c5.xlarge'.

accept_type

(str): The model output format to be used for getting inferences with the shadow endpoint. Valid values are "text/csv" for CSV and "application/jsonlines". Default is the same as content_type.

content_type

(str): The model input format to be used for getting inferences with the shadow endpoint. Valid values are "text/csv" for CSV and "application/jsonlines". Default is the same as dataset format.

content_template

(str): A template string to be used to construct the model input from dataset instances. It is only used when "model_content_type" is "application/jsonlines". The template should have one and only one placeholder $features which will be replaced by a features list for to form the model inference input.

custom_attributes

(str): Provides additional information about a request for an inference submitted to a model hosted at an Amazon SageMaker endpoint. The information is an opaque value that is forwarded verbatim. You could use this value, for example, to provide an ID that you can use to track a request or to provide other metadata that a service endpoint was programmed to process. The value must consist of no more than 1024 visible US-ASCII characters as specified in Section 3.3.6. Field Value Components ( https://tools.ietf.org/html/rfc7230#section-3.2.6) of the Hypertext Transfer Protocol (HTTP/1.1).

accelerator_type

(str): The Elastic Inference accelerator type to deploy to the model endpoint instance for making inferences to the model, see https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html.

endpoint_name_prefix

(str): The endpoint name prefix of a new endpoint. Must follow pattern "^[a-zA-Z0-9](-\*[a-zA-Z0-9]".


Method get_predictor_config()

Returns part of the predictor dictionary of the analysis config.

Usage
ModelConfig$get_predictor_config()

Method format()

format class

Usage
ModelConfig$format()

Method clone()

The objects of this class are cloneable with this method.

Usage
ModelConfig$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


DyfanJones/sagemaker-r-common documentation built on June 14, 2022, 10:31 p.m.