Skip to content

Instantly share code, notes, and snippets.

@johnynek
johnynek / median.scala
Created May 7, 2015 01:50
simple streaming median
import scala.collection.immutable.Queue
object Median {
sealed trait State {
def count: Long
def add(item: Long): State
def median: Long
}
case class Start(window: Queue[Long], max: Int, countInt: Int) extends State {
def count = countInt
## There's a dependency on https://github.com/JohnLangford/vowpal_wabbit
library(plyr)
library(dplyr)
library(magrittr)
library(pander)
panderOptions('table.split.table', Inf)
LOW_MEAN <- .4
HIGH_MEAN <- .6
@springcoil
springcoil / probineq.ipynb
Created November 9, 2015 17:04
A short article on probability inequalities
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AustinRochford
AustinRochford / dirichlet_process_pym3.ipynb
Created April 7, 2016 12:34
Dirichlet Process Notebook from Alex Reiner
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tomokishii
tomokishii / mnist_cnn_bn.py
Last active December 14, 2023 03:55
MNIST using Batch Normalization - TensorFlow tutorial
#
# mnist_cnn_bn.py date. 5/21/2016
# date. 6/2/2017 check TF 1.1 compatibility
#
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
@jkleint
jkleint / timeseries_cnn.py
Created July 29, 2016 04:05
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
#!/usr/bin/env python
"""
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
"""
from __future__ import print_function, division
import numpy as np
from keras.layers import Convolution1D, Dense, MaxPooling1D, Flatten
from keras.models import Sequential
@AustinRochford
AustinRochford / DDP Regression.ipynb
Created September 27, 2016 15:29
Dependent Dirichlet Process Regression
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@leeper
leeper / oversampling.R
Created October 25, 2016 10:58
Graphs showing SRS versus stratified/oversampling
# uses dev version of 'waffle'
# devtools::install_github("leeper/waffle@patch-1")
library("waffle")
library("extrafont")
# population
set.seed(1)
N <- 900L
p <- c("Small Group 1" = 30, "Big Group 1" = 420, "Small Group 2" = 30,"Big Group 2" = 420)
glyph <- c("male", "female")[sample(1:2, N, TRUE)]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.