Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . sagemaker ]

create-algorithm

Description

Create a machine learning algorithm that you can use in Amazon SageMaker and list in the AWS Marketplace.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  create-algorithm
--algorithm-name <value>
[--algorithm-description <value>]
--training-specification <value>
[--inference-specification <value>]
[--validation-specification <value>]
[--certify-for-marketplace | --no-certify-for-marketplace]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--algorithm-name (string)

The name of the algorithm.

--algorithm-description (string)

A description of the algorithm.

--training-specification (structure)

Specifies details about training jobs run by this algorithm, including the following:

  • The Amazon ECR path of the container and the version digest of the algorithm.
  • The hyperparameters that the algorithm supports.
  • The instance types that the algorithm supports for training.
  • Whether the algorithm supports distributed training.
  • The metrics that the algorithm emits to Amazon CloudWatch.
  • Which metrics that the algorithm emits can be used as the objective metric for hyperparameter tuning jobs.
  • The input channels that the algorithm supports for training data. For example, an algorithm might support train , validation , and test channels.

JSON Syntax:

{
  "TrainingImage": "string",
  "TrainingImageDigest": "string",
  "SupportedHyperParameters": [
    {
      "Name": "string",
      "Description": "string",
      "Type": "Integer"|"Continuous"|"Categorical"|"FreeText",
      "Range": {
        "IntegerParameterRangeSpecification": {
          "MinValue": "string",
          "MaxValue": "string"
        },
        "ContinuousParameterRangeSpecification": {
          "MinValue": "string",
          "MaxValue": "string"
        },
        "CategoricalParameterRangeSpecification": {
          "Values": ["string", ...]
        }
      },
      "IsTunable": true|false,
      "IsRequired": true|false,
      "DefaultValue": "string"
    }
    ...
  ],
  "SupportedTrainingInstanceTypes": ["ml.m4.xlarge"|"ml.m4.2xlarge"|"ml.m4.4xlarge"|"ml.m4.10xlarge"|"ml.m4.16xlarge"|"ml.m5.large"|"ml.m5.xlarge"|"ml.m5.2xlarge"|"ml.m5.4xlarge"|"ml.m5.12xlarge"|"ml.m5.24xlarge"|"ml.c4.xlarge"|"ml.c4.2xlarge"|"ml.c4.4xlarge"|"ml.c4.8xlarge"|"ml.p2.xlarge"|"ml.p2.8xlarge"|"ml.p2.16xlarge"|"ml.p3.2xlarge"|"ml.p3.8xlarge"|"ml.p3.16xlarge"|"ml.c5.xlarge"|"ml.c5.2xlarge"|"ml.c5.4xlarge"|"ml.c5.9xlarge"|"ml.c5.18xlarge", ...],
  "SupportsDistributedTraining": true|false,
  "MetricDefinitions": [
    {
      "Name": "string",
      "Regex": "string"
    }
    ...
  ],
  "TrainingChannels": [
    {
      "Name": "string",
      "Description": "string",
      "IsRequired": true|false,
      "SupportedContentTypes": ["string", ...],
      "SupportedCompressionTypes": ["None"|"Gzip", ...],
      "SupportedInputModes": ["Pipe"|"File", ...]
    }
    ...
  ],
  "SupportedTuningJobObjectiveMetrics": [
    {
      "Type": "Maximize"|"Minimize",
      "MetricName": "string"
    }
    ...
  ]
}

--inference-specification (structure)

Specifies details about inference jobs that the algorithm runs, including the following:

  • The Amazon ECR paths of containers that contain the inference code and model artifacts.
  • The instance types that the algorithm supports for transform jobs and real-time endpoints used for inference.
  • The input and output content formats that the algorithm supports for inference.

Shorthand Syntax:

Containers=[{ContainerHostname=string,Image=string,ImageDigest=string,ModelDataUrl=string,ProductId=string},{ContainerHostname=string,Image=string,ImageDigest=string,ModelDataUrl=string,ProductId=string}],SupportedTransformInstanceTypes=string,string,SupportedRealtimeInferenceInstanceTypes=string,string,SupportedContentTypes=string,string,SupportedResponseMIMETypes=string,string

JSON Syntax:

{
  "Containers": [
    {
      "ContainerHostname": "string",
      "Image": "string",
      "ImageDigest": "string",
      "ModelDataUrl": "string",
      "ProductId": "string"
    }
    ...
  ],
  "SupportedTransformInstanceTypes": ["ml.m4.xlarge"|"ml.m4.2xlarge"|"ml.m4.4xlarge"|"ml.m4.10xlarge"|"ml.m4.16xlarge"|"ml.c4.xlarge"|"ml.c4.2xlarge"|"ml.c4.4xlarge"|"ml.c4.8xlarge"|"ml.p2.xlarge"|"ml.p2.8xlarge"|"ml.p2.16xlarge"|"ml.p3.2xlarge"|"ml.p3.8xlarge"|"ml.p3.16xlarge"|"ml.c5.xlarge"|"ml.c5.2xlarge"|"ml.c5.4xlarge"|"ml.c5.9xlarge"|"ml.c5.18xlarge"|"ml.m5.large"|"ml.m5.xlarge"|"ml.m5.2xlarge"|"ml.m5.4xlarge"|"ml.m5.12xlarge"|"ml.m5.24xlarge", ...],
  "SupportedRealtimeInferenceInstanceTypes": ["ml.t2.medium"|"ml.t2.large"|"ml.t2.xlarge"|"ml.t2.2xlarge"|"ml.m4.xlarge"|"ml.m4.2xlarge"|"ml.m4.4xlarge"|"ml.m4.10xlarge"|"ml.m4.16xlarge"|"ml.m5.large"|"ml.m5.xlarge"|"ml.m5.2xlarge"|"ml.m5.4xlarge"|"ml.m5.12xlarge"|"ml.m5.24xlarge"|"ml.c4.large"|"ml.c4.xlarge"|"ml.c4.2xlarge"|"ml.c4.4xlarge"|"ml.c4.8xlarge"|"ml.p2.xlarge"|"ml.p2.8xlarge"|"ml.p2.16xlarge"|"ml.p3.2xlarge"|"ml.p3.8xlarge"|"ml.p3.16xlarge"|"ml.c5.large"|"ml.c5.xlarge"|"ml.c5.2xlarge"|"ml.c5.4xlarge"|"ml.c5.9xlarge"|"ml.c5.18xlarge", ...],
  "SupportedContentTypes": ["string", ...],
  "SupportedResponseMIMETypes": ["string", ...]
}

--validation-specification (structure)

Specifies configurations for one or more training jobs and that Amazon SageMaker runs to test the algorithm's training code and, optionally, one or more batch transform jobs that Amazon SageMaker runs to test the algorithm's inference code.

JSON Syntax:

{
  "ValidationRole": "string",
  "ValidationProfiles": [
    {
      "ProfileName": "string",
      "TrainingJobDefinition": {
        "TrainingInputMode": "Pipe"|"File",
        "HyperParameters": {"string": "string"
          ...},
        "InputDataConfig": [
          {
            "ChannelName": "string",
            "DataSource": {
              "S3DataSource": {
                "S3DataType": "ManifestFile"|"S3Prefix"|"AugmentedManifestFile",
                "S3Uri": "string",
                "S3DataDistributionType": "FullyReplicated"|"ShardedByS3Key",
                "AttributeNames": ["string", ...]
              }
            },
            "ContentType": "string",
            "CompressionType": "None"|"Gzip",
            "RecordWrapperType": "None"|"RecordIO",
            "InputMode": "Pipe"|"File",
            "ShuffleConfig": {
              "Seed": long
            }
          }
          ...
        ],
        "OutputDataConfig": {
          "KmsKeyId": "string",
          "S3OutputPath": "string"
        },
        "ResourceConfig": {
          "InstanceType": "ml.m4.xlarge"|"ml.m4.2xlarge"|"ml.m4.4xlarge"|"ml.m4.10xlarge"|"ml.m4.16xlarge"|"ml.m5.large"|"ml.m5.xlarge"|"ml.m5.2xlarge"|"ml.m5.4xlarge"|"ml.m5.12xlarge"|"ml.m5.24xlarge"|"ml.c4.xlarge"|"ml.c4.2xlarge"|"ml.c4.4xlarge"|"ml.c4.8xlarge"|"ml.p2.xlarge"|"ml.p2.8xlarge"|"ml.p2.16xlarge"|"ml.p3.2xlarge"|"ml.p3.8xlarge"|"ml.p3.16xlarge"|"ml.c5.xlarge"|"ml.c5.2xlarge"|"ml.c5.4xlarge"|"ml.c5.9xlarge"|"ml.c5.18xlarge",
          "InstanceCount": integer,
          "VolumeSizeInGB": integer,
          "VolumeKmsKeyId": "string"
        },
        "StoppingCondition": {
          "MaxRuntimeInSeconds": integer
        }
      },
      "TransformJobDefinition": {
        "MaxConcurrentTransforms": integer,
        "MaxPayloadInMB": integer,
        "BatchStrategy": "MultiRecord"|"SingleRecord",
        "Environment": {"string": "string"
          ...},
        "TransformInput": {
          "DataSource": {
            "S3DataSource": {
              "S3DataType": "ManifestFile"|"S3Prefix"|"AugmentedManifestFile",
              "S3Uri": "string"
            }
          },
          "ContentType": "string",
          "CompressionType": "None"|"Gzip",
          "SplitType": "None"|"Line"|"RecordIO"|"TFRecord"
        },
        "TransformOutput": {
          "S3OutputPath": "string",
          "Accept": "string",
          "AssembleWith": "None"|"Line",
          "KmsKeyId": "string"
        },
        "TransformResources": {
          "InstanceType": "ml.m4.xlarge"|"ml.m4.2xlarge"|"ml.m4.4xlarge"|"ml.m4.10xlarge"|"ml.m4.16xlarge"|"ml.c4.xlarge"|"ml.c4.2xlarge"|"ml.c4.4xlarge"|"ml.c4.8xlarge"|"ml.p2.xlarge"|"ml.p2.8xlarge"|"ml.p2.16xlarge"|"ml.p3.2xlarge"|"ml.p3.8xlarge"|"ml.p3.16xlarge"|"ml.c5.xlarge"|"ml.c5.2xlarge"|"ml.c5.4xlarge"|"ml.c5.9xlarge"|"ml.c5.18xlarge"|"ml.m5.large"|"ml.m5.xlarge"|"ml.m5.2xlarge"|"ml.m5.4xlarge"|"ml.m5.12xlarge"|"ml.m5.24xlarge",
          "InstanceCount": integer,
          "VolumeKmsKeyId": "string"
        }
      }
    }
    ...
  ]
}

--certify-for-marketplace | --no-certify-for-marketplace (boolean)

Whether to certify the algorithm so that it can be listed in AWS Marketplace.

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.

Output

AlgorithmArn -> (string)

The Amazon Resource Name (ARN) of the new algorithm.