WITH qa AS (
SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME
FROM qa_edw_pstg.information_schema.tables
),
prod AS (
SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME
FROM prd_edw_pstg.information_schema.tables
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 uuid | |
import streamlit as st | |
######### | |
# Helpers | |
######### | |
def get_completion(question, session_id): |
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
# /// script | |
# requires-python = ">=3.12" | |
# dependencies = [ | |
# "boto3", | |
# "sagemaker", | |
# ] | |
# /// | |
import subprocess | |
import time | |
from time import gmtime, strftime |
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
# /// script | |
# requires-python = ">=3.12" | |
# dependencies = [ | |
# "duckdb", | |
# "polars", | |
# "pyarrow", | |
# "pyathena", | |
# "s3fs", | |
# ] | |
# /// |
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
"""View remote jobs in a 3 day interval.""" | |
BASE_URL = "https://www.linkedin.com/jobs/search/" | |
def get_linkedin_jobs(search, n_days=3, remote=True): | |
# time | |
seconds_in_day = 86400 | |
n_seconds = n_days * seconds_in_day | |
query = BASE_URL + "?f_TPR=r" + str(n_seconds) |
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 typing import Union | |
import numpy as np | |
import pandas as pd | |
def create_sample_weights( | |
y_train: np.ndarray, | |
X_train: Union[np.ndarray, pd.DataFrame] | |
) -> pd.Series: | |
y_series = pd.DataFrame({"y": y_train})["y"] |
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 numpy import log, exp | |
from scipy.special import betaln as logbeta | |
def probability_B_beats_A(α_A, β_A, α_B, β_B): | |
total = 0.0 | |
for i in range(α_B): | |
total += exp( | |
logbeta(α_A + i, β_B + β_A) | |
- log(β_B + i) |
%pip install "whatlies[sentence_tfm]" # quotes for my fellow zsh users
import numpy as np
from whatlies.language import SentenceTFMLanguage
from sklearn.pipeline import Pipeline
from sklearn.linear_model import LogisticRegression
pipe = Pipeline([
("embed", SentenceTFMLanguage('distilbert-base-nli-stsb-mean-tokens')),
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
# venv | |
# usage: | |
# $ venv .recsys | |
function venv { | |
default_envdir=".env" | |
envdir=${1:-$default_envdir} | |
if [ ! -d $envdir ]; then | |
python3.7 -m virtualenv -p python3.7 $envdir | |
echo -e "\x1b[38;5;2m✔ Created virtualenv $envdir\x1b[0m" |
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
#!/bin/bash | |
flag=$1 | |
if [[ $flag == 'DL' ]]; then | |
# ------------- | |
# Deep Learning | |
# ------------- | |
echo "Configuring GPU for Deep Learning..." | |
sudo apt-get install -y libnvidia-common-440 | |
sudo apt-get install -y cuda | |
sudo apt-get install -y cuda-drivers |
NewerOlder