XGBoostModel: XGBoostModel Class

XGBoostModelR Documentation

XGBoostModel Class

Description

An XGBoost SageMaker “Model“ that can be deployed to a SageMaker “Endpoint“.

Super classes

sagemaker.mlcore::ModelBase -> sagemaker.mlcore::Model -> sagemaker.mlcore::FrameworkModel -> XGBoostModel

Methods

Public methods

Inherited methods

Method new()

Initialize an XGBoostModel.

Usage
XGBoostModel$new(
  model_data,
  role,
  entry_point,
  framework_version,
  image_uri = NULL,
  py_version = "py3",
  predictor_cls = XGBoostPredictor,
  model_server_workers = NULL,
  ...
)
Arguments
model_data

(str): The S3 location of a SageMaker model data “.tar.gz“ file.

role

(str): An AWS IAM role (either name or full ARN). The Amazon SageMaker training jobs and APIs that create Amazon SageMaker endpoints use this role to access training data and model artifacts. After the endpoint is created, the inference code might use the IAM role, if it needs to access an AWS resource.

entry_point

(str): Path (absolute or relative) to the Python source file which should be executed as the entry point to model hosting. If “source_dir“ is specified, then “entry_point“ must point to a file located at the root of “source_dir“.

framework_version

(str): XGBoost version you want to use for executing your model training code.

image_uri

(str): A Docker image URI (default: None). If not specified, a default image for XGBoost is be used.

py_version

(str): Python version you want to use for executing your model training code (default: 'py3').

predictor_cls

(callable[str, sagemaker.session.Session]): A function to call to create a predictor with an endpoint name and SageMaker “Session“. If specified, “deploy()“ returns the result of invoking this function on the created endpoint name.

model_server_workers

(int): Optional. The number of worker processes used by the inference server. If None, server will use one worker per vCPU.

...

: Keyword arguments passed to the “FrameworkModel“ initializer.


Method prepare_container_def()

Return a container definition with framework configuration set in model environment variables.

Usage
XGBoostModel$prepare_container_def(
  instance_type = NULL,
  accelerator_type = NULL
)
Arguments
instance_type

(str): The EC2 instance type to deploy this Model to. This parameter is unused because XGBoost supports only CPU.

accelerator_type

(str): The Elastic Inference accelerator type to deploy to the instance for loading and making inferences to the model. This parameter is unused because accelerator types are not supported by XGBoostModel.

Returns

dict[str, str]: A container definition object usable with the CreateModel API.


Method serving_image_uri()

Create a URI for the serving image.

Usage
XGBoostModel$serving_image_uri(region_name, instance_type)
Arguments
region_name

(str): AWS region where the image is uploaded.

instance_type

(str): SageMaker instance type. Must be a CPU instance type.

Returns

str: The appropriate image URI based on the given parameters.


Method clone()

The objects of this class are cloneable with this method.

Usage
XGBoostModel$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


DyfanJones/sagemaker-r-mlframework documentation built on March 18, 2022, 7:41 a.m.