layout | title | description | tags | ||
---|---|---|---|---|---|
default |
SQL Style Guide |
A guide to writing clean, clear, and consistent SQL. |
|
I hereby claim:
- I am nsorros on github.
- I am nsorros (https://keybase.io/nsorros) on keybase.
- I have a public key ASAEEg7pTTGnMmH5072YFHU-nsM9ZR1hjAIjTjTg2lC7Ego
To claim this, I am signing this object:
This file contains 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
update-requirements: VENV := /tmp/update-requirements-venv | |
update-requirements: ## updates requirements | |
@if [ -d $(VENV) ]; then rm -rf $(VENV); fi | |
@mkdir -p $(VENV) | |
$(PYTHON) -m venv $(VENV) | |
$(PIP) install --upgrade pip | |
$(PIP) install -r unpinned_requirements.txt | |
echo "Created by update-requirements. Do not edit." > requirements.txt | |
$(PIP) freeze | grep -v pkg-resources==0.0.0 >> requirements.txt |
This file contains 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
PYTHON := python3.8 | |
VENV := venv | |
PIP := venv/bin/pip | |
.PHONY: venv | |
venv: ## creates virtualenv | |
@if [ -d $(VENV) ]; then rm -rf $(VENV); fi | |
@mkdir -p $(VENV) | |
$(PYTHON) -m venv $(VENV) | |
$(PIP) install --upgrade pip |
This file contains 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
PROJECT_NAME := classifier | |
PROJECT_BUCKET := datascience/$(PROJECT_NAME) | |
.PHONY: sync_data | |
sync_data: ## syncs data to s3 | |
aws s3 sync data/ s3://$(PROJECT_BUCKET)/data | |
aws s3 s3://$(PROJECT_BUCKET)/data data/ | |
.PHONY: sync_models | |
sync_models: ## syncs models to s3 |
This file contains 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 argparse | |
def train(data_path, model_path, learning_rate, batch_size): | |
... | |
if __name__ == "__main__": | |
argparser = argparse.ArgumentParser() | |
argparser.add_argument("--data_path", type=str, help="path to train data") |
This file contains 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
[DEFAULT] | |
version = 2021.03.0 | |
[preprocess] | |
raw_data_path = data/raw/data.xlsx | |
processed_data_path = data/processed/data.jsonl | |
[train] | |
data_path = data/processed/data.jsonl | |
model_path = models/cnn-2021.03.0/ |
This file contains 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 configparser | |
import argparse | |
def train(data_path, model_path, learning_rate, batch_size): | |
... | |
if __name__ == "__main__": | |
argparser = argparse.ArgumentParser() | |
argparser.add_argument("--config", type=str, help="path to config file") | |
args = argparser.parse_args() |
This file contains 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
from functools import partial | |
import time | |
from sklearn.metrics import f1_score | |
from scipy.sparse import load_npz | |
import numpy as np | |
import typer | |
def f(Y_pred_proba, Y_test, thresholds): |
This file contains 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
from functools import partial | |
import time | |
from sklearn.metrics import multilabel_confusion_matrix | |
from scipy.sparse import load_npz | |
import numpy as np | |
import typer | |
if "line_profiler" not in dir() and "profile" not in dir(): | |
# no-op profile decorator |
OlderNewer