Skip to content

Instantly share code, notes, and snippets.

View chrisking's full-sized avatar

Chris King chrisking

View GitHub Profile
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',
@chrisking
chrisking / related.json
Last active January 29, 2020 15:12
related
@chrisking
chrisking / demo.json
Created January 28, 2020 15:23
schema
{
"Attributes": [
{
"AttributeName": "item_id",
"AttributeType": "string"
},
{
"AttributeName": "aspect_ratio",
"AttributeType": "string"
},
@chrisking
chrisking / .py
Created November 26, 2019 18:29
batch sample
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}}
{
"Version": "2012-10-17",
"Id": "PersonalizeS3BucketAccessPolicy",
"Statement": [
{
"Sid": "PersonalizeS3BucketAccessPolicy",
"Effect": "Allow",
"Principal": {
"Service": "personalize.amazonaws.com"
},
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.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"forecast:*",
"s3:*",
"iam:GetRole",
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
@chrisking
chrisking / fabfile.py
Created October 29, 2018 17:29
Fabric Config for Starting / Stopping EC2 Instances with SSH and Jupyter Access
# 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):