AutoML: AutoML Class

AutoMLR Documentation

AutoML Class

Description

A class for creating and interacting with SageMaker AutoML jobs.

Methods

Public methods


Method new()

Initialize AutoML class Place holder doc string

Usage
AutoML$new(
  role,
  target_attribute_name,
  output_kms_key = NULL,
  output_path = NULL,
  base_job_name = NULL,
  compression_type = NULL,
  sagemaker_session = NULL,
  volume_kms_key = NULL,
  encrypt_inter_container_traffic = FALSE,
  vpc_config = NULL,
  problem_type = NULL,
  max_candidates = NULL,
  max_runtime_per_training_job_in_seconds = NULL,
  total_job_runtime_in_seconds = NULL,
  job_objective = NULL,
  generate_candidate_definitions_only = FALSE,
  tags = NULL
)
Arguments
role

:

target_attribute_name

:

output_kms_key

:

output_path

:

base_job_name

:

compression_type

:

sagemaker_session

:

volume_kms_key

:

encrypt_inter_container_traffic

:

vpc_config

:

problem_type

:

max_candidates

:

max_runtime_per_training_job_in_seconds

:

total_job_runtime_in_seconds

:

job_objective

:

generate_candidate_definitions_only

:

tags

:


Method fit()

Create an AutoML Job with the input dataset.

Usage
AutoML$fit(inputs = NULL, wait = TRUE, logs = TRUE, job_name = NULL)
Arguments
inputs

(str or list[str] or AutoMLInput): Local path or S3 Uri where the training data is stored. Or an AutoMLInput object. If a local path is provided, the dataset will be uploaded to an S3 location.

wait

(bool): Whether the call should wait until the job completes (default: True).

logs

(bool): Whether to show the logs produced by the job. Only meaningful when wait is True (default: True). if “wait“ is False, “logs“ will be set to False as well.

job_name

(str): Training job name. If not specified, the estimator generates a default job name, based on the training image name and current timestamp.


Method attach()

Attach to an existing AutoML job. Creates and returns a AutoML bound to an existing automl job.

Usage
AutoML$attach(auto_ml_job_name, sagemaker_session = NULL)
Arguments
auto_ml_job_name

(str): AutoML job name

sagemaker_session

(sagemaker.session.Session): A SageMaker Session object, used for SageMaker interactions (default: None). If not specified, the one originally associated with the “AutoML“ instance is used.

Returns

sagemaker.automl.AutoML: A “AutoML“ instance with the attached automl job.


Method describe_auto_ml_job()

Returns the job description of an AutoML job for the given job name.

Usage
AutoML$describe_auto_ml_job(job_name = NULL)
Arguments
job_name

(str): The name of the AutoML job to describe. If None, will use object's latest_auto_ml_job name.

Returns

dict: A dictionary response with the AutoML Job description.


Method best_candidate()

Returns the best candidate of an AutoML job for a given name.

Usage
AutoML$best_candidate(job_name = NULL)
Arguments
job_name

(str): The name of the AutoML job. If None, will use object's .current_auto_ml_job_name.

Returns

dict: A dictionary with information of the best candidate.


Method list_candidates()

Returns the list of candidates of an AutoML job for a given name.

Usage
AutoML$list_candidates(
  job_name = NULL,
  status_equals = NULL,
  candidate_name = NULL,
  candidate_arn = NULL,
  sort_order = NULL,
  sort_by = NULL,
  max_results = NULL
)
Arguments
job_name

(str): The name of the AutoML job. If None, will use object's .current_job name.

status_equals

(str): Filter the result with candidate status, values could be "Completed", "InProgress", "Failed", "Stopped", "Stopping"

candidate_name

(str): The name of a specified candidate to list. Default to None.

candidate_arn

(str): The Arn of a specified candidate to list. Default to None.

sort_order

(str): The order that the candidates will be listed in result. Default to None.

sort_by

(str): The value that the candidates will be sorted by. Default to None.

max_results

(int): The number of candidates will be listed in results, between 1 to 100. Default to None. If None, will return all the candidates.

Returns

list: A list of dictionaries with candidates information.


Method create_model()

Creates a model from a given candidate or the best candidate from the job.

Usage
AutoML$create_model(
  name,
  sagemaker_session = NULL,
  candidate = NULL,
  vpc_config = NULL,
  enable_network_isolation = FALSE,
  model_kms_key = NULL,
  predictor_cls = NULL,
  inference_response_keys = NULL
)
Arguments
name

(str): The pipeline model name.

sagemaker_session

(sagemaker.session.Session): A SageMaker Session object, used for SageMaker interactions (default: None). If not specified, the one originally associated with the “AutoML“ instance is used.:

candidate

(CandidateEstimator or dict): a CandidateEstimator used for deploying to a SageMaker Inference Pipeline. If None, the best candidate will be used. If the candidate input is a dict, a CandidateEstimator will be created from it.

vpc_config

(dict): Specifies a VPC that your training jobs and hosted models have access to. Contents include "SecurityGroupIds" and "Subnets".

enable_network_isolation

(bool): Isolates the training container. No inbound or outbound network calls can be made, except for calls between peers within a training cluster for distributed training. Default: False

model_kms_key

(str): KMS key ARN used to encrypt the repacked model archive file if the model is repacked

predictor_cls

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

inference_response_keys

(list): List of keys for response content. The order of the keys will dictate the content order in the response.

Returns

PipelineModel object.


Method deploy()

Deploy a candidate to a SageMaker Inference Pipeline.

Usage
AutoML$deploy(
  initial_instance_count,
  instance_type,
  serializer = NULL,
  deserializer = NULL,
  candidate = NULL,
  sagemaker_session = NULL,
  name = NULL,
  endpoint_name = NULL,
  tags = NULL,
  wait = TRUE,
  vpc_config = NULL,
  enable_network_isolation = FALSE,
  model_kms_key = NULL,
  predictor_cls = NULL,
  inference_response_keys = NULL
)
Arguments
initial_instance_count

(int): The initial number of instances to run in the “Endpoint“ created from this “Model“.

instance_type

(str): The EC2 instance type to deploy this Model to. For example, 'ml.p2.xlarge'.

serializer

(:class:'~sagemaker.serializers.BaseSerializer'): A serializer object, used to encode data for an inference endpoint (default: None). If “serializer“ is not None, then “serializer“ will override the default serializer. The default serializer is set by the “predictor_cls“.

deserializer

(:class:'~sagemaker.deserializers.BaseDeserializer'): A deserializer object, used to decode data from an inference

candidate

(CandidateEstimator or dict): a CandidateEstimator used for deploying to a SageMaker Inference Pipeline. If None, the best candidate will be used. If the candidate input is a dict, a CandidateEstimator will be created from it.

sagemaker_session

(sagemaker.session.Session): A SageMaker Session object, used for SageMaker interactions (default: None). If not specified, the one originally associated with the “AutoML“ instance is used.

name

(str): The pipeline model name. If None, a default model name will be selected on each “deploy“.

endpoint_name

(str): The name of the endpoint to create (default: None). If not specified, a unique endpoint name will be created.

tags

(List[dict[str, str]]): The list of tags to attach to this specific endpoint.

wait

(bool): Whether the call should wait until the deployment of model completes (default: True).

vpc_config

(dict): Specifies a VPC that your training jobs and hosted models have access to. Contents include "SecurityGroupIds" and "Subnets".

enable_network_isolation

(bool): Isolates the training container. No inbound or outbound network calls can be made, except for calls between peers within a training cluster for distributed training. Default: False

model_kms_key

(str): KMS key ARN used to encrypt the repacked model archive file if the model is repacked

predictor_cls

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

inference_response_keys

(list): List of keys for response content. The order of the keys will dictate the content order in the response.

endpoint

(default: None). If “deserializer“ is not None, then “deserializer“ will override the default deserializer. The default deserializer is set by the “predictor_cls“.

Returns

callable[string, sagemaker.session.Session] or “None“: If “predictor_cls“ is specified, the invocation of “self.predictor_cls“ on the created endpoint name. Otherwise, “None“.


Method validate_and_update_inference_response()

Validates the requested inference keys and updates response content. On validation, also updates the inference containers to emit appropriate response content in the inference response.

Usage
AutoML$validate_and_update_inference_response(
  inference_containers,
  inference_response_keys
)
Arguments
inference_containers

(list): list of inference containers

inference_response_keys

(list): list of inference response keys


Method format()

format class

Usage
AutoML$format()

Method clone()

The objects of this class are cloneable with this method.

Usage
AutoML$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.