2020/06/05 - Amazon Personalize - 4 new 2 updated api methods
Changes [Personalize] Adds ability to create and apply filters.
Deletes a filter.
See also: AWS API Documentation
Request Syntax
client.delete_filter( filterArn='string' )
string
[REQUIRED]
The ARN of the filter to delete.
None
Describes a filter's properties.
See also: AWS API Documentation
Request Syntax
client.describe_filter( filterArn='string' )
string
[REQUIRED]
The ARN of the filter to describe.
dict
Response Syntax
{ 'filter': { 'name': 'string', 'filterArn': 'string', 'creationDateTime': datetime(2015, 1, 1), 'lastUpdatedDateTime': datetime(2015, 1, 1), 'datasetGroupArn': 'string', 'failureReason': 'string', 'filterExpression': 'string', 'status': 'string' } }
Response Structure
(dict) --
filter (dict) --
The filter's details.
name (string) --
The name of the filter.
filterArn (string) --
The ARN of the filter.
creationDateTime (datetime) --
The time at which the filter was created.
lastUpdatedDateTime (datetime) --
The time at which the filter was last updated.
datasetGroupArn (string) --
The ARN of the dataset group to which the filter belongs.
failureReason (string) --
If the filter failed, the reason for its failure.
filterExpression (string) --
Specifies the type of item interactions to filter out of recommendation results. The filter expression must follow the following format:
EXCLUDE itemId WHERE INTERACTIONS.event_type in ("EVENT_TYPE")
Where "EVENT_TYPE" is the type of event to filter out. For more information, see Using Filters with Amazon Personalize.
status (string) --
The status of the filter.
Creates a recommendation filter. For more information, see Using Filters with Amazon Personalize.
See also: AWS API Documentation
Request Syntax
client.create_filter( name='string', datasetGroupArn='string', filterExpression='string' )
string
[REQUIRED]
The name of the filter to create.
string
[REQUIRED]
The ARN of the dataset group that the filter will belong to.
string
[REQUIRED]
The filter expression that designates the interaction types that the filter will filter out. A filter expression must follow the following format:
EXCLUDE itemId WHERE INTERACTIONS.event_type in ("EVENT_TYPE")
Where "EVENT_TYPE" is the type of event to filter out. To filter out all items with any interactions history, set "*" as the EVENT_TYPE. For more information, see Using Filters with Amazon Personalize.
dict
Response Syntax
{ 'filterArn': 'string' }
Response Structure
(dict) --
filterArn (string) --
The ARN of the new filter.
Lists all filters that belong to a given dataset group.
See also: AWS API Documentation
Request Syntax
client.list_filters( datasetGroupArn='string', nextToken='string', maxResults=123 )
string
The ARN of the dataset group that contains the filters.
string
A token returned from the previous call to ListFilters for getting the next set of filters (if they exist).
integer
The maximum number of filters to return.
dict
Response Syntax
{ 'Filters': [ { 'name': 'string', 'filterArn': 'string', 'creationDateTime': datetime(2015, 1, 1), 'lastUpdatedDateTime': datetime(2015, 1, 1), 'datasetGroupArn': 'string', 'failureReason': 'string', 'status': 'string' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
Filters (list) --
A list of returned filters.
(dict) --
A short summary of a filter's attributes.
name (string) --
The name of the filter.
filterArn (string) --
The ARN of the filter.
creationDateTime (datetime) --
The time at which the filter was created.
lastUpdatedDateTime (datetime) --
The time at which the filter was last updated.
datasetGroupArn (string) --
The ARN of the dataset group to which the filter belongs.
failureReason (string) --
If the filter failed, the reason for the failure.
status (string) --
The status of the filter.
nextToken (string) --
A token for getting the next set of filters (if they exist).
{'filterArn': 'string'}
Creates a batch inference job. The operation can handle up to 50 million records and the input file must be in JSON format. For more information, see recommendations-batch.
See also: AWS API Documentation
Request Syntax
client.create_batch_inference_job( jobName='string', solutionVersionArn='string', filterArn='string', numResults=123, jobInput={ 's3DataSource': { 'path': 'string', 'kmsKeyArn': 'string' } }, jobOutput={ 's3DataDestination': { 'path': 'string', 'kmsKeyArn': 'string' } }, roleArn='string' )
string
[REQUIRED]
The name of the batch inference job to create.
string
[REQUIRED]
The Amazon Resource Name (ARN) of the solution version that will be used to generate the batch inference recommendations.
string
The ARN of the filter to apply to the batch inference job. For more information on using filters, see Using Filters with Amazon Personalize.
integer
The number of recommendations to retreive.
dict
[REQUIRED]
The Amazon S3 path that leads to the input file to base your recommendations on. The input material must be in JSON format.
s3DataSource (dict) -- [REQUIRED]
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.
path (string) -- [REQUIRED]
The file path of the Amazon S3 bucket.
kmsKeyArn (string) --
The Amazon Resource Name (ARN) of the Amazon Key Management Service (KMS) key that Amazon Personalize uses to encrypt or decrypt the input and output files of a batch inference job.
dict
[REQUIRED]
The path to the Amazon S3 bucket where the job's output will be stored.
s3DataDestination (dict) -- [REQUIRED]
Information on the Amazon S3 bucket in which the batch inference job's output is stored.
path (string) -- [REQUIRED]
The file path of the Amazon S3 bucket.
kmsKeyArn (string) --
The Amazon Resource Name (ARN) of the Amazon Key Management Service (KMS) key that Amazon Personalize uses to encrypt or decrypt the input and output files of a batch inference job.
string
[REQUIRED]
The ARN of the Amazon Identity and Access Management role that has permissions to read and write to your input and out Amazon S3 buckets respectively.
dict
Response Syntax
{ 'batchInferenceJobArn': 'string' }
Response Structure
(dict) --
batchInferenceJobArn (string) --
The ARN of the batch inference job.
{'batchInferenceJob': {'filterArn': 'string'}}
Gets the properties of a batch inference job including name, Amazon Resource Name (ARN), status, input and output configurations, and the ARN of the solution version used to generate the recommendations.
See also: AWS API Documentation
Request Syntax
client.describe_batch_inference_job( batchInferenceJobArn='string' )
string
[REQUIRED]
The ARN of the batch inference job to describe.
dict
Response Syntax
{ 'batchInferenceJob': { 'jobName': 'string', 'batchInferenceJobArn': 'string', 'filterArn': 'string', 'failureReason': 'string', 'solutionVersionArn': 'string', 'numResults': 123, 'jobInput': { 's3DataSource': { 'path': 'string', 'kmsKeyArn': 'string' } }, 'jobOutput': { 's3DataDestination': { 'path': 'string', 'kmsKeyArn': 'string' } }, 'roleArn': 'string', 'status': 'string', 'creationDateTime': datetime(2015, 1, 1), 'lastUpdatedDateTime': datetime(2015, 1, 1) } }
Response Structure
(dict) --
batchInferenceJob (dict) --
Information on the specified batch inference job.
jobName (string) --
The name of the batch inference job.
batchInferenceJobArn (string) --
The Amazon Resource Name (ARN) of the batch inference job.
filterArn (string) --
The ARN of the filter used on the batch inference job.
failureReason (string) --
If the batch inference job failed, the reason for the failure.
solutionVersionArn (string) --
The Amazon Resource Name (ARN) of the solution version from which the batch inference job was created.
numResults (integer) --
The number of recommendations generated by the batch inference job. This number includes the error messages generated for failed input records.
jobInput (dict) --
The Amazon S3 path that leads to the input data used to generate the batch inference job.
s3DataSource (dict) --
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.
path (string) --
The file path of the Amazon S3 bucket.
kmsKeyArn (string) --
The Amazon Resource Name (ARN) of the Amazon Key Management Service (KMS) key that Amazon Personalize uses to encrypt or decrypt the input and output files of a batch inference job.
jobOutput (dict) --
The Amazon S3 bucket that contains the output data generated by the batch inference job.
s3DataDestination (dict) --
Information on the Amazon S3 bucket in which the batch inference job's output is stored.
path (string) --
The file path of the Amazon S3 bucket.
kmsKeyArn (string) --
The Amazon Resource Name (ARN) of the Amazon Key Management Service (KMS) key that Amazon Personalize uses to encrypt or decrypt the input and output files of a batch inference job.
roleArn (string) --
The ARN of the Amazon Identity and Access Management (IAM) role that requested the batch inference job.
status (string) --
The status of the batch inference job. The status is one of the following values:
PENDING
IN PROGRESS
ACTIVE
CREATE FAILED
creationDateTime (datetime) --
The time at which the batch inference job was created.
lastUpdatedDateTime (datetime) --
The time at which the batch inference job was last updated.