sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
- Download zsh-autosuggestions by
| from tensorflow import keras | |
| from tensorflow.python.lib.io import file_io | |
| class ModelCheckpointInGcs(keras.callbacks.ModelCheckpoint): | |
| def __init__( | |
| self, | |
| filepath, | |
| gcs_dir: str, | |
| monitor="val_loss", |
| AWSTemplateFormatVersion: 2010-09-09 | |
| Transform: AWS::Serverless-2016-10-31 | |
| Parameters: | |
| BucketPrefix: | |
| Type: String | |
| Description: "The prefix used for all S3 buckets." | |
| AllowedPattern: "[a-z-]+" | |
| Resources: |
| import pandas as pd | |
| import pandas.io.sql as sqlio | |
| import psycopg2 | |
| conn = psycopg2.connect("host='{}' port={} dbname='{}' user={} password={}".format(host, port, dbname, username, pwd)) | |
| sql = "select count(*) from table;" | |
| dat = sqlio.read_sql_query(sql, conn) | |
| conn = None |
| from typing import Iterable, TypeVar | |
| T = TypeVar("T") | |
| def argmin(elements: Iterable[T]) -> int: | |
| """Returns first index of smallest element.""" | |
| return min(enumerate(elements), key=lambda x: x[1])[0] | |
| import re | |
| from typing import List, Set | |
| filename = "" | |
| out_filename = "" | |
| records: List[str] = [] | |
| ts_pattern = re.compile(r"^.+(\d{2}/\w{3}/\d{4}:\d{2}:\d{2}:\d{2})") | |
| seen: Set[str] = set() | |
| import os | |
| import random | |
| import numpy as np | |
| import pandas as pd | |
| from sklearn.linear_model import Lasso | |
| from sklearn.pipeline import Pipeline | |
| from sklearn.model_selection import cross_val_score, GridSearchCV | |
| from sklearn.preprocessing import RobustScaler | |
| from sklearn.decomposition import PCA | |
| from sklearn import metrics |
| #!/bin/python3 | |
| import math | |
| import os | |
| import random | |
| import re | |
| import sys | |
| import pandas as pd | |
| from statsmodels.tsa.arima_model import ARIMA | |
| from typing import List |
orders (3.4m rows, 206k users):
order_id: order identifieruser_id: customer identifiereval_set: which evaluation set this order belongs in (see SET described below)order_number: the order sequence number for this user (1 = first, n = nth)order_dow: the day of the week the order was placed onorder_hour_of_day: the hour of the day the order was placed ondays_since_prior: days since the last order, capped at 30 (with NAs for order_number = 1)products (50k rows):