The AWS SDK for JavaScript v2 has reached end-of-support.
We recommend that you migrate to AWS SDK for JavaScript v3. For additional details and information on how to migrate, please refer to the announcement.

Class: AWS.Personalize

Inherits:
AWS.Service show all
Identifier:
personalize
API Version:
2018-05-22
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

Amazon Personalize is a machine learning service that makes it easy to add individualized recommendations to customers.

Sending a Request Using Personalize

var personalize = new AWS.Personalize();
personalize.createBatchInferenceJob(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the Personalize object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var personalize = new AWS.Personalize({apiVersion: '2018-05-22'});

You can also set the API version globally in AWS.config.apiVersions using the personalize service identifier:

AWS.config.apiVersions = {
  personalize: '2018-05-22',
  // other service API versions
};

var personalize = new AWS.Personalize();

Version:

  • 2018-05-22

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.Personalize(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a Personalize object

var personalize = new AWS.Personalize({apiVersion: '2018-05-22'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String|AWS.Endpoint)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com' or an Endpoint object.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.Personalize.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.Personalize.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.Personalize.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to true

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied. The function is only called for retryable errors.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean|undefined)

    whether to call operations with endpoints given by service dynamically. Setting this

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

  • useFipsEndpoint (Boolean)

    Enables FIPS compatible endpoints. Defaults to false.

  • useDualstackEndpoint (Boolean)

    Enables IPv6 dualstack endpoint. Defaults to false.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

createBatchInferenceJob(params = {}, callback) ⇒ AWS.Request

Generates batch recommendations based on a list of items or users stored in Amazon S3 and exports the recommendations to an Amazon S3 bucket.

To generate batch recommendations, specify the ARN of a solution version and an Amazon S3 URI for the input and output data. For user personalization, popular items, and personalized ranking solutions, the batch inference job generates a list of recommended items for each user ID in the input file. For related items solutions, the job generates a list of recommended items for each item ID in the input file.

For more information, see Creating a batch inference job .

If you use the Similar-Items recipe, Amazon Personalize can add descriptive themes to batch recommendations. To generate themes, set the job's mode to THEME_GENERATION and specify the name of the field that contains item names in the input data.

For more information about generating themes, see Batch recommendations with themes from Content Generator .

You can't get batch recommendations with the Trending-Now or Next-Best-Action recipes.

Service Reference:

Examples:

Calling the createBatchInferenceJob operation

var params = {
  jobInput: { /* required */
    s3DataSource: { /* required */
      path: 'STRING_VALUE', /* required */
      kmsKeyArn: 'STRING_VALUE'
    }
  },
  jobName: 'STRING_VALUE', /* required */
  jobOutput: { /* required */
    s3DataDestination: { /* required */
      path: 'STRING_VALUE', /* required */
      kmsKeyArn: 'STRING_VALUE'
    }
  },
  roleArn: 'STRING_VALUE', /* required */
  solutionVersionArn: 'STRING_VALUE', /* required */
  batchInferenceJobConfig: {
    itemExplorationConfig: {
      '<ParameterName>': 'STRING_VALUE',
      /* '<ParameterName>': ... */
    }
  },
  batchInferenceJobMode: BATCH_INFERENCE | THEME_GENERATION,
  filterArn: 'STRING_VALUE',
  numResults: 'NUMBER_VALUE',
  tags: [
    {
      tagKey: 'STRING_VALUE', /* required */
      tagValue: 'STRING_VALUE' /* required */
    },
    /* more items */
  ],
  themeGenerationConfig: {
    fieldsForThemeGeneration: { /* required */
      itemName: 'STRING_VALUE' /* required */
    }
  }
};
personalize.createBatchInferenceJob(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • jobName — (String)

      The name of the batch inference job to create.

    • solutionVersionArn — (String)

      The Amazon Resource Name (ARN) of the solution version that will be used to generate the batch inference recommendations.

    • filterArn — (String)

      The ARN of the filter to apply to the batch inference job. For more information on using filters, see Filtering batch recommendations.

    • numResults — (Integer)

      The number of recommendations to retrieve.

    • jobInput — (map)

      The Amazon S3 path that leads to the input file to base your recommendations on. The input material must be in JSON format.

      • s3DataSourcerequired — (map)

        The URI of the Amazon S3 location that contains your input data. The Amazon S3 bucket must be in the same region as the API endpoint you are calling.

        • pathrequired — (String)

          The file path of the Amazon S3 bucket.

        • kmsKeyArn — (String)

          The Amazon Resource Name (ARN) of the Key Management Service (KMS) key that Amazon Personalize uses to encrypt or decrypt the input and output files.

    • jobOutput — (map)

      The path to the Amazon S3 bucket where the job's output will be stored.

      • s3DataDestinationrequired — (map)

        Information on the Amazon S3 bucket in which the batch inference job's output is stored.

        • pathrequired — (String)

          The file path of the Amazon S3 bucket.

        • kmsKeyArn — (String)

          The Amazon Resource Name (ARN) of the Key Management Service (KMS) key that Amazon Personalize uses to encrypt or decrypt the input and output files.

    • roleArn — (String)

      The ARN of the Amazon Identity and Access Management role that has permissions to read and write to your input and output Amazon S3 buckets respectively.

    • batchInferenceJobConfig — (map)

      The configuration details of a batch inference job.

      • itemExplorationConfig — (map<String>)

        A string to string map specifying the exploration configuration hyperparameters, including explorationWeight and explorationItemAgeCutOff, you want to use to configure the amount of item exploration Amazon Personalize uses when recommending items. See User-Personalization.

    • tags — (Array<map>)

      A list of tags to apply to the batch inference job.

      • tagKeyrequired — (String)

        One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.

      • tagValuerequired — (String)

        The optional part of a key-value pair that makes up a tag. A value acts as a descriptor within a tag category (key).

    • batchInferenceJobMode — (String)

      The mode of the batch inference job. To generate descriptive themes for groups of similar items, set the job mode to THEME_GENERATION. If you don't want to generate themes, use the default BATCH_INFERENCE.

      When you get batch recommendations with themes, you will incur additional costs. For more information, see Amazon Personalize pricing.

      Possible values include:
      • "BATCH_INFERENCE"
      • "THEME_GENERATION"
    • themeGenerationConfig — (map)

      For theme generation jobs, specify the name of the column in your Items dataset that contains each item's name.

      • fieldsForThemeGenerationrequired — (map)

        Fields used to generate descriptive themes for a batch inference job.

        • itemNamerequired — (String)

          The name of the Items dataset column that stores the name of each item in the dataset.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • batchInferenceJobArn — (String)

        The ARN of the batch inference job.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createBatchSegmentJob(params = {}, callback) ⇒ AWS.Request

Creates a batch segment job. The operation can handle up to 50 million records and the input file must be in JSON format. For more information, see Getting batch recommendations and user segments.

Service Reference:

Examples:

Calling the createBatchSegmentJob operation

var params = {
  jobInput: { /* required */
    s3DataSource: { /* required */
      path: 'STRING_VALUE', /* required */
      kmsKeyArn: 'STRING_VALUE'
    }
  },
  jobName: 'STRING_VALUE', /* required */
  jobOutput: { /* required */
    s3DataDestination: { /* required */
      path: 'STRING_VALUE', /* required */
      kmsKeyArn: 'STRING_VALUE'
    }
  },
  roleArn: 'STRING_VALUE', /* required */
  solutionVersionArn: 'STRING_VALUE', /* required */
  filterArn: 'STRING_VALUE',
  numResults: 'NUMBER_VALUE',
  tags: [
    {
      tagKey: 'STRING_VALUE', /* required */
      tagValue: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
personalize.createBatchSegmentJob(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • jobName — (String)

      The name of the batch segment job to create.

    • solutionVersionArn — (String)

      The Amazon Resource Name (ARN) of the solution version you want the batch segment job to use to generate batch segments.

    • filterArn — (String)

      The ARN of the filter to apply to the batch segment job. For more information on using filters, see Filtering batch recommendations.

    • numResults — (Integer)

      The number of predicted users generated by the batch segment job for each line of input data. The maximum number of users per segment is 5 million.

    • jobInput — (map)

      The Amazon S3 path for the input data used to generate the batch segment job.

      • s3DataSourcerequired — (map)

        The configuration details of an Amazon S3 input or output bucket.

        • pathrequired — (String)

          The file path of the Amazon S3 bucket.

        • kmsKeyArn — (String)

          The Amazon Resource Name (ARN) of the Key Management Service (KMS) key that Amazon Personalize uses to encrypt or decrypt the input and output files.

    • jobOutput — (map)

      The Amazon S3 path for the bucket where the job's output will be stored.

      • s3DataDestinationrequired — (map)

        The configuration details of an Amazon S3 input or output bucket.

        • pathrequired — (String)

          The file path of the Amazon S3 bucket.

        • kmsKeyArn — (String)

          The Amazon Resource Name (ARN) of the Key Management Service (KMS) key that Amazon Personalize uses to encrypt or decrypt the input and output files.

    • roleArn — (String)

      The ARN of the Amazon Identity and Access Management role that has permissions to read and write to your input and output Amazon S3 buckets respectively.

    • tags — (Array<map>)

      A list of tags to apply to the batch segment job.

      • tagKeyrequired — (String)

        One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.

      • tagValuerequired — (String)

        The optional part of a key-value pair that makes up a tag. A value acts as a descriptor within a tag category (key).

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • batchSegmentJobArn — (String)

        The ARN of the batch segment job.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createCampaign(params = {}, callback) ⇒ AWS.Request

You incur campaign costs while it is active. To avoid unnecessary costs, make sure to delete the campaign when you are finished. For information about campaign costs, see Amazon Personalize pricing.

Creates a campaign that deploys a solution version. When a client calls the GetRecommendations and GetPersonalizedRanking APIs, a campaign is specified in the request.

Minimum Provisioned TPS and Auto-Scaling

A high minProvisionedTPS will increase your cost. We recommend starting with 1 for minProvisionedTPS (the default). Track your usage using Amazon CloudWatch metrics, and increase the minProvisionedTPS as necessary.

When you create an Amazon Personalize campaign, you can specify the minimum provisioned transactions per second (minProvisionedTPS) for the campaign. This is the baseline transaction throughput for the campaign provisioned by Amazon Personalize. It sets the minimum billing charge for the campaign while it is active. A transaction is a single GetRecommendations or GetPersonalizedRanking request. The default minProvisionedTPS is 1.

If your TPS increases beyond the minProvisionedTPS, Amazon Personalize auto-scales the provisioned capacity up and down, but never below minProvisionedTPS. There's a short time delay while the capacity is increased that might cause loss of transactions. When your traffic reduces, capacity returns to the minProvisionedTPS.

You are charged for the the minimum provisioned TPS or, if your requests exceed the minProvisionedTPS, the actual TPS. The actual TPS is the total number of recommendation requests you make. We recommend starting with a low minProvisionedTPS, track your usage using Amazon CloudWatch metrics, and then increase the minProvisionedTPS as necessary.

For more information about campaign costs, see Amazon Personalize pricing.

Status

A campaign can be in one of the following states:

  • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

  • DELETE PENDING > DELETE IN_PROGRESS

To get the campaign status, call DescribeCampaign.

Note: Wait until the status of the campaign is ACTIVE before asking the campaign for recommendations.

Related APIs

Service Reference:

Examples:

Calling the createCampaign operation

var params = {
  name: 'STRING_VALUE', /* required */
  solutionVersionArn: 'STRING_VALUE', /* required */
  campaignConfig: {
    enableMetadataWithRecommendations: true || false,
    itemExplorationConfig: {
      '<ParameterName>': 'STRING_VALUE',
      /* '<ParameterName>': ... */
    },
    syncWithLatestSolutionVersion: true || false
  },
  minProvisionedTPS: 'NUMBER_VALUE',
  tags: [
    {
      tagKey: 'STRING_VALUE', /* required */
      tagValue: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
personalize.createCampaign(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • name — (String)

      A name for the new campaign. The campaign name must be unique within your account.

    • solutionVersionArn — (String)

      The Amazon Resource Name (ARN) of the trained model to deploy with the campaign. To specify the latest solution version of your solution, specify the ARN of your solution in SolutionArn/$LATEST format. You must use this format if you set syncWithLatestSolutionVersion to True in the CampaignConfig.

      To deploy a model that isn't the latest solution version of your solution, specify the ARN of the solution version.

      For more information about automatic campaign updates, see Enabling automatic campaign updates.

    • minProvisionedTPS — (Integer)

      Specifies the requested minimum provisioned transactions (recommendations) per second that Amazon Personalize will support. A high minProvisionedTPS will increase your bill. We recommend starting with 1 for minProvisionedTPS (the default). Track your usage using Amazon CloudWatch metrics, and increase the minProvisionedTPS as necessary.

    • campaignConfig — (map)

      The configuration details of a campaign.

      • itemExplorationConfig — (map<String>)

        Specifies the exploration configuration hyperparameters, including explorationWeight and explorationItemAgeCutOff, you want to use to configure the amount of item exploration Amazon Personalize uses when recommending items. Provide itemExplorationConfig data only if your solution uses the User-Personalization recipe.

      • enableMetadataWithRecommendations — (Boolean)

        Whether metadata with recommendations is enabled for the campaign. If enabled, you can specify the columns from your Items dataset in your request for recommendations. Amazon Personalize returns this data for each item in the recommendation response. For information about enabling metadata for a campaign, see Enabling metadata in recommendations for a campaign.

        If you enable metadata in recommendations, you will incur additional costs. For more information, see Amazon Personalize pricing.

      • syncWithLatestSolutionVersion — (Boolean)

        Whether the campaign automatically updates to use the latest solution version (trained model) of a solution. If you specify True, you must specify the ARN of your solution for the SolutionVersionArn parameter. It must be in SolutionArn/$LATEST format. The default is False and you must manually update the campaign to deploy the latest solution version.

        For more information about automatic campaign updates, see Enabling automatic campaign updates.

    • tags — (Array<map>)

      A list of tags to apply to the campaign.

      • tagKeyrequired — (String)

        One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.

      • tagValuerequired — (String)

        The optional part of a key-value pair that makes up a tag. A value acts as a descriptor within a tag category (key).

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • campaignArn — (String)

        The Amazon Resource Name (ARN) of the campaign.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createDataDeletionJob(params = {}, callback) ⇒ AWS.Request

Creates a batch job that deletes all references to specific users from an Amazon Personalize dataset group in batches. You specify the users to delete in a CSV file of userIds in an Amazon S3 bucket. After a job completes, Amazon Personalize no longer trains on the users’ data and no longer considers the users when generating user segments. For more information about creating a data deletion job, see Deleting users.

  • Your input file must be a CSV file with a single USER_ID column that lists the users IDs. For more information about preparing the CSV file, see Preparing your data deletion file and uploading it to Amazon S3.

  • To give Amazon Personalize permission to access your input CSV file of userIds, you must specify an IAM service role that has permission to read from the data source. This role needs GetObject and ListBucket permissions for the bucket and its content. These permissions are the same as importing data. For information on granting access to your Amazon S3 bucket, see Giving Amazon Personalize Access to Amazon S3 Resources.

After you create a job, it can take up to a day to delete all references to the users from datasets and models. Until the job completes, Amazon Personalize continues to use the data when training. And if you use a User Segmentation recipe, the users might appear in user segments.

Status

A data deletion job can have one of the following statuses:

  • PENDING > IN_PROGRESS > COMPLETED -or- FAILED

To get the status of the data deletion job, call DescribeDataDeletionJob API operation and specify the Amazon Resource Name (ARN) of the job. If the status is FAILED, the response includes a failureReason key, which describes why the job failed.

Related APIs

Service Reference:

Examples:

Calling the createDataDeletionJob operation

var params = {
  dataSource: { /* required */
    dataLocation: 'STRING_VALUE'
  },
  datasetGroupArn: 'STRING_VALUE', /* required */
  jobName: 'STRING_VALUE', /* required */
  roleArn: 'STRING_VALUE', /* required */
  tags: [
    {
      tagKey: 'STRING_VALUE', /* required */
      tagValue: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
personalize.createDataDeletionJob(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • jobName — (String)

      The name for the data deletion job.

    • datasetGroupArn — (String)

      The Amazon Resource Name (ARN) of the dataset group that has the datasets you want to delete records from.

    • dataSource — (map)

      The Amazon S3 bucket that contains the list of userIds of the users to delete.

      • dataLocation — (String)

        For dataset import jobs, the path to the Amazon S3 bucket where the data that you want to upload to your dataset is stored. For data deletion jobs, the path to the Amazon S3 bucket that stores the list of records to delete.

        For example:

        s3://bucket-name/folder-name/fileName.csv

        If your CSV files are in a folder in your Amazon S3 bucket and you want your import job or data deletion job to consider multiple files, you can specify the path to the folder. With a data deletion job, Amazon Personalize uses all files in the folder and any sub folder. Use the following syntax with a / after the folder name:

        s3://bucket-name/folder-name/

    • roleArn — (String)

      The Amazon Resource Name (ARN) of the IAM role that has permissions to read from the Amazon S3 data source.

    • tags — (Array<map>)

      A list of tags to apply to the data deletion job.

      • tagKeyrequired — (String)

        One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.

      • tagValuerequired — (String)

        The optional part of a key-value pair that makes up a tag. A value acts as a descriptor within a tag category (key).

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • dataDeletionJobArn — (String)

        The Amazon Resource Name (ARN) of the data deletion job.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createDataset(params = {}, callback) ⇒ AWS.Request

Creates an empty dataset and adds it to the specified dataset group. Use CreateDatasetImportJob to import your training data to a dataset.

There are 5 types of datasets:

  • Item interactions

  • Items

  • Users

  • Action interactions

  • Actions

Each dataset type has an associated schema with required field types. Only the Item interactions dataset is required in order to train a model (also referred to as creating a solution).

A dataset can be in one of the following states:

  • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

  • DELETE PENDING > DELETE IN_PROGRESS

To get the status of the dataset, call DescribeDataset.

Related APIs

Service Reference:

Examples:

Calling the createDataset operation

var params = {
  datasetGroupArn: 'STRING_VALUE', /* required */
  datasetType: 'STRING_VALUE', /* required */
  name: 'STRING_VALUE', /* required */
  schemaArn: 'STRING_VALUE', /* required */
  tags: [
    {
      tagKey: 'STRING_VALUE', /* required */
      tagValue: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
personalize.createDataset(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • name — (String)

      The name for the dataset.

    • schemaArn — (String)

      The ARN of the schema to associate with the dataset. The schema defines the dataset fields.

    • datasetGroupArn — (String)

      The Amazon Resource Name (ARN) of the dataset group to add the dataset to.

    • datasetType — (String)

      The type of dataset.

      One of the following (case insensitive) values:

      • Interactions

      • Items

      • Users

      • Actions

      • Action_Interactions

    • tags — (Array<map>)

      A list of tags to apply to the dataset.

      • tagKeyrequired — (String)

        One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.

      • tagValuerequired — (String)

        The optional part of a key-value pair that makes up a tag. A value acts as a descriptor within a tag category (key).

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • datasetArn — (String)

        The ARN of the dataset.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createDatasetExportJob(params = {}, callback) ⇒ AWS.Request

Creates a job that exports data from your dataset to an Amazon S3 bucket. To allow Amazon Personalize to export the training data, you must specify an service-linked IAM role that gives Amazon Personalize PutObject permissions for your Amazon S3 bucket. For information, see Exporting a dataset in the Amazon Personalize developer guide.

Status

A dataset export job can be in one of the following states:

  • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

To get the status of the export job, call DescribeDatasetExportJob, and specify the Amazon Resource Name (ARN) of the dataset export job. The dataset export is complete when the status shows as ACTIVE. If the status shows as CREATE FAILED, the response includes a failureReason key, which describes why the job failed.

Service Reference:

Examples:

Calling the createDatasetExportJob operation

var params = {
  datasetArn: 'STRING_VALUE', /* required */
  jobName: 'STRING_VALUE', /* required */
  jobOutput: { /* required */
    s3DataDestination: { /* required */
      path: 'STRING_VALUE', /* required */
      kmsKeyArn: 'STRING_VALUE'
    }
  },
  roleArn: 'STRING_VALUE', /* required */
  ingestionMode: BULK | PUT | ALL,
  tags: [
    {
      tagKey: 'STRING_VALUE', /* required */
      tagValue: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
personalize.createDatasetExportJob(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • jobName — (String)

      The name for the dataset export job.

    • datasetArn — (String)

      The Amazon Resource Name (ARN) of the dataset that contains the data to export.

    • ingestionMode — (String)

      The data to export, based on how you imported the data. You can choose to export only BULK data that you imported using a dataset import job, only PUT data that you imported incrementally (using the console, PutEvents, PutUsers and PutItems operations), or ALL for both types. The default value is PUT.

      Possible values include:
      • "BULK"
      • "PUT"
      • "ALL"
    • roleArn — (String)

      The Amazon Resource Name (ARN) of the IAM service role that has permissions to add data to your output Amazon S3 bucket.

    • jobOutput — (map)

      The path to the Amazon S3 bucket where the job's output is stored.

      • s3DataDestinationrequired — (map)

        The configuration details of an Amazon S3 input or output bucket.

        • pathrequired — (String)

          The file path of the Amazon S3 bucket.

        • kmsKeyArn — (String)

          The Amazon Resource Name (ARN) of the Key Management Service (KMS) key that Amazon Personalize uses to encrypt or decrypt the input and output files.

    • tags — (Array<map>)

      A list of tags to apply to the dataset export job.

      • tagKeyrequired — (String)

        One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.

      • tagValuerequired — (String)

        The optional part of a key-value pair that makes up a tag. A value acts as a descriptor within a tag category (key).

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • datasetExportJobArn — (String)

        The Amazon Resource Name (ARN) of the dataset export job.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createDatasetGroup(params = {}, callback) ⇒ AWS.Request

Creates an empty dataset group. A dataset group is a container for Amazon Personalize resources. A dataset group can contain at most three datasets, one for each type of dataset:

  • Item interactions

  • Items

  • Users

  • Actions

  • Action interactions

A dataset group can be a Domain dataset group, where you specify a domain and use pre-configured resources like recommenders, or a Custom dataset group, where you use custom resources, such as a solution with a solution version, that you deploy with a campaign. If you start with a Domain dataset group, you can still add custom resources such as solutions and solution versions trained with recipes for custom use cases and deployed with campaigns.

A dataset group can be in one of the following states:

  • CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED

  • DELETE PENDING

To get the status of the dataset group, call DescribeDatasetGroup. If the status shows as CREATE FAILED, the response includes a failureReason key, which describes why the creation failed.

Note: You must wait until the status of the dataset group is ACTIVE before adding a dataset to the group.

You can specify an Key Management Service (KMS) key to encrypt the datasets in the group. If you specify a KMS key, you must also include an Identity and Access Management (IAM) role that has permission to access the key.

APIs that require a dataset group ARN in the request

Related APIs

Service Reference:

Examples:

Calling the createDatasetGroup operation

var params = {
  name: 'STRING_VALUE', /* required */
  domain: ECOMMERCE | VIDEO_ON_DEMAND,
  kmsKeyArn: 'STRING_VALUE',
  roleArn: 'STRING_VALUE',
  tags: [
    {
      tagKey: 'STRING_VALUE', /* required */
      tagValue: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
personalize.createDatasetGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • name — (String)

      The name for the new dataset group.

    • roleArn — (String)

      The ARN of the Identity and Access Management (IAM) role that has permissions to access the Key Management Service (KMS) key. Supplying an IAM role is only valid when also specifying a KMS key.

    • kmsKeyArn — (String)

      The Amazon Resource Name (ARN) of a Key Management Service (KMS) key used to encrypt the datasets.

    • domain — (String)

      The domain of the dataset group. Specify a domain to create a Domain dataset group. The domain you specify determines the default schemas for datasets and the use cases available for recommenders. If you don't specify a domain, you create a Custom dataset group with solution versions that you deploy with a campaign.

      Possible values include:
      • "ECOMMERCE"
      • "VIDEO_ON_DEMAND"
    • tags — (Array<map>)

      A list of tags to apply to the dataset group.