Amazon SageMaker
Developer Guide

CreateHyperParameterTuningJob

Starts a hyperparameter tuning job.

Request Syntax

{ "HyperParameterTuningJobConfig": { "HyperParameterTuningJobObjective": { "MetricName": "string", "Type": "string" }, "ParameterRanges": { "CategoricalParameterRanges": [ { "Name": "string", "Values": [ "string" ] } ], "ContinuousParameterRanges": [ { "MaxValue": "string", "MinValue": "string", "Name": "string" } ], "IntegerParameterRanges": [ { "MaxValue": "string", "MinValue": "string", "Name": "string" } ] }, "ResourceLimits": { "MaxNumberOfTrainingJobs": number, "MaxParallelTrainingJobs": number }, "Strategy": "string" }, "HyperParameterTuningJobName": "string", "Tags": [ { "Key": "string", "Value": "string" } ], "TrainingJobDefinition": { "AlgorithmSpecification": { "MetricDefinitions": [ { "Name": "string", "Regex": "string" } ], "TrainingImage": "string", "TrainingInputMode": "string" }, "InputDataConfig": [ { "ChannelName": "string", "CompressionType": "string", "ContentType": "string", "DataSource": { "S3DataSource": { "S3DataDistributionType": "string", "S3DataType": "string", "S3Uri": "string" } }, "InputMode": "string", "RecordWrapperType": "string" } ], "OutputDataConfig": { "KmsKeyId": "string", "S3OutputPath": "string" }, "ResourceConfig": { "InstanceCount": number, "InstanceType": "string", "VolumeKmsKeyId": "string", "VolumeSizeInGB": number }, "RoleArn": "string", "StaticHyperParameters": { "string" : "string" }, "StoppingCondition": { "MaxRuntimeInSeconds": number }, "VpcConfig": { "SecurityGroupIds": [ "string" ], "Subnets": [ "string" ] } } }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

HyperParameterTuningJobConfig

The HyperParameterTuningJobConfig object that describes the tuning job, including the search strategy, metric used to evaluate training jobs, ranges of parameters to search, and resource limits for the tuning job.

Type: HyperParameterTuningJobConfig object

Required: Yes

HyperParameterTuningJobName

The name of the tuning job. This name is the prefix for the names of all training jobs that this tuning job launches. The name must be unique within the same AWS account and AWS Region. Names are not case sensitive, and must be between 1-32 characters.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 32.

Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*

Required: Yes

Tags

An array of key-value pairs. You can use tags to categorize your AWS resources in different ways, for example, by purpose, owner, or environment. For more information, see AWS Tagging Strategies.

Tags that you specify for the tuning job are also added to all training jobs that the tuning job launches.

Type: Array of Tag objects

Array Members: Minimum number of 0 items. Maximum number of 50 items.

Required: No

TrainingJobDefinition

The HyperParameterTrainingJobDefinition object that describes the training jobs that this tuning job launches, including static hyperparameters, input data configuration, output data configuration, resource configuration, and stopping condition.

Type: HyperParameterTrainingJobDefinition object

Required: Yes

Response Syntax

{ "HyperParameterTuningJobArn": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

HyperParameterTuningJobArn

The Amazon Resource Name (ARN) of the tuning job.

Type: String

Length Constraints: Maximum length of 256.

Pattern: arn:aws[a-z\-]*:sagemaker:[a-z0-9\-]*:[0-9]{12}:hyper-parameter-tuning-job/.*

Errors

For information about the errors that are common to all actions, see Common Errors.

ResourceInUse

Resource being accessed is in use.

HTTP Status Code: 400

ResourceLimitExceeded

You have exceeded an Amazon SageMaker resource limit. For example, you might have too many training jobs created.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: