This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| meta_schema_val = [{"AttributeName": "item_id", "AttributeType": "string"}, | |
| {"AttributeName": "style", "AttributeType": "string"}, | |
| {"AttributeName": "category", "AttributeType": "string"}, | |
| {"AttributeName": "subcat", "AttributeType": "string"}] | |
| meta_schema = {"Attributes": meta_schema_val} | |
| response = forecast.create_dataset(Domain="CUSTOM", | |
| DatasetType='ITEM_METADATA', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Attributes": [ | |
| { | |
| "AttributeName": "item_id", | |
| "AttributeType": "string" | |
| }, | |
| { | |
| "AttributeName": "aspect_ratio", | |
| "AttributeType": "string" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| impot boto3 | |
| personalize_rec = boto3.client(service_name='personalize') | |
| batchInferenceJobArn = personalize_rec.create_batch_inference_job ( | |
| solutionVersionArn = solution_version_arn, | |
| jobName = "RI_Workshop_Batch_Export_Job2", | |
| roleArn = role_arn, | |
| jobInput = | |
| {"s3DataSource": {"path": s3_input_path}}, | |
| jobOutput = | |
| {"s3DataDestination":{"path": s3_output_path}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Version": "2012-10-17", | |
| "Id": "PersonalizeS3BucketAccessPolicy", | |
| "Statement": [ | |
| { | |
| "Sid": "PersonalizeS3BucketAccessPolicy", | |
| "Effect": "Allow", | |
| "Principal": { | |
| "Service": "personalize.amazonaws.com" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| item_schema = { | |
| "type": "record", | |
| "name": "Item", | |
| "namespace": "com.amazonaws.personalize.schema", | |
| "fields": [ | |
| { | |
| "name": "ACTION", | |
| "type": "int" | |
| }, | |
| { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Sid": "VisualEditor0", | |
| "Effect": "Allow", | |
| "Action": [ | |
| "forecast:*", | |
| "s3:*", | |
| "iam:GetRole", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| asn1crypto==0.24.0 | |
| bcrypt==3.1.4 | |
| boto==2.49.0 | |
| certifi==2018.4.16 | |
| cffi==1.11.5 | |
| chardet==3.0.4 | |
| cryptography==2.2.2 | |
| enum34==1.1.6 | |
| Fabric==1.13.1 | |
| idna==2.7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # import fabrics API functions | |
| from fabric.api import * | |
| from requests import get | |
| # Update with your security group and instance ID | |
| SECURITY_GROUP = "sg-9bdc1fd0" | |
| INSTANCE_ID = "i-06c072747655b16e5" | |
| def modify_security_group(enable=False): |