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 ... | |
| import fire | |
| class CustomerModel(BaseModel): | |
| def __init__(self): | |
| super().__init__() | |
| def train_model(lookback_days=30: int): |
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 boto3 | |
| from datetime import datetime | |
| import numpy as np | |
| from fastapi import FastAPI | |
| app = FastAPI() | |
| dynamodb = boto3.resource("dynamodb") | |
| s3 = boto3.client('s3') | |
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 boto3 | |
| dynamodb = boto3.resource("dynamodb") | |
| params = { | |
| 'TableName': "customer_purchase_ts", | |
| "KeySchema": [ | |
| {"AttributeName": "customer_id", "KeyType": "HASH"}, | |
| {"AttributeName": "transaction_date_epoch", "KeyType": "RANGE"} | |
| ], |
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 boto3 | |
| dynamodb = boto3.resource("dynamodb") | |
| params = { | |
| "TableName": "customer_purchase_ts", | |
| "KeySchema": [ | |
| {"AttributeName": "customer_id", "KeyType": "HASH"} | |
| ], | |
| "LocalSecondaryIndexes": [ |
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
| /* | |
| purchase table example | |
| transaction_date | customer_id | purchase_price | category | |
| 2022-01-01 customer_A $10 jewelry | |
| 2022-01-02 customer_A $1 t-shirts | |
| ... |
OlderNewer