Skip to content

Instantly share code, notes, and snippets.

View aus10powell's full-sized avatar

Austin aus10powell

View GitHub Profile
SELECT
transaction_date,
AVG(transaction_amount) AS rolling_avg
FROM (
SELECT
DATE_TRUNC('day', transaction_time) AS transaction_date,
SUM(transaction_amount) AS transaction_amount
FROM
transactions
@aus10powell
aus10powell / gist:c142369842b08cd78408678597ba0ed9
Created July 1, 2020 03:47
Pandas Odds-Ratio Display and Test
#####################
# 2x2 Contingency table w/ test
#####################
import stats
d = {
"flagged": [221, 221],
"not-flagged": [2,10],
@aus10powell
aus10powell / snorkel_example_code.ipynb
Created February 4, 2020 15:04
This is some snippets of code to get started with Snorkel
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aus10powell
aus10powell / .py
Last active February 16, 2019 22:12
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.nn import functional as F
class TextCNN(nn.Module):
def __init__(self, batch_size, output_size, in_channels, out_channels, kernel_heights,
stride, padding, keep_probab, vocab_size, embedding_dim, weights):
super(TextCNN, self).__init__()
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.nn import functional as F
class TextCNN(nn.Module):
def __init__(self, batch_size, output_size, in_channels, out_channels, kernel_heights,
stride, padding, keep_probab, vocab_size, embedding_dim, weights):
super(TextCNN, self).__init__()
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.nn import functional as F
class TextCNN(nn.Module):
def __init__(self, batch_size, output_size, in_channels, out_channels, kernel_heights,
stride, padding, keep_probab, vocab_size, embedding_dim, weights):
@aus10powell
aus10powell / .ipynb
Last active February 16, 2019 22:24
This is a comparison of different ways of using td-idf method for different subdomains of a website which are for different US cities
{
"cells": [
{
"cell_type": "code",
"execution_count": 28,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [