Skip to content

Instantly share code, notes, and snippets.

@finbarrtimbers
finbarrtimbers / index.html
Last active December 29, 2015 09:49 — forked from benjchristensen/index.html
Interactive demo of proposed LCA fee
<!--
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@finbarrtimbers
finbarrtimbers / 466.md
Last active December 30, 2015 01:49
Notes from meeting with Dr. Greiner
  • forbidden set is a huge cluster of dups ==> randomly select a subset of the forbidden ones

  • test it on never before seen data

  • test without Anahita's data

  • which of Anahita's data did we use? ==> did we use Anahita's word lists?

@finbarrtimbers
finbarrtimbers / index.html
Last active August 29, 2015 13:56 — forked from benjchristensen/index.html
Purity Test score vs. time spent as member of LCA
<html>
<head>
<title>Purity Test score vs. length of tenure</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke: steelblue;
stroke-width: 1;
fill: none;
@finbarrtimbers
finbarrtimbers / plot-acf-ma.r
Last active August 29, 2015 13:56 — forked from anonymous/plot-acf-ma.r
Ever wanted to plot the autocorrelation function of an ARIMA time series in R? Here's an easy way to do it.
# Creates a MA(3) model
ma.parameters <- c(0.5, 0.5, 0.2)
ma.model <- arima.sim(model=list(ma.parameters,n=100)
# Plots the autocorrelation function of the MA(3) model
acf(ma.model)
@finbarrtimbers
finbarrtimbers / TODO.md
Created July 3, 2014 00:51
A script used in my research to extract wordlists from software engineering textbooks.

TODO

  • Split the logic into "retrieving data" and "processing data." Right now, the code has big, multi-purpose functions.

  • Refactor the code, making it in line with PEP 8, and (maybe?) add assertion statements to act as unit tests.

@finbarrtimbers
finbarrtimbers / blackjack.py
Last active August 29, 2015 14:03
Text-based, one player blackjack game.
#!/usr/local/bin/python
"text-based Blackjack program. One player, one dealer; dealer hits to 17."
import random
import sys
class Card(object):
"Represents a playing card. Used here in DECK."
def __init__(self, name, value, suit, index):
self.name = name
self.value = value
@finbarrtimbers
finbarrtimbers / bwplot.R
Created July 11, 2014 17:05
Box & Whiskers plot in R from a .csv file.
library("cvTools")
library('reshape2')
policy.all <- read.csv('data.csv', header = TRUE, sep = ',')
# > policy.all
# iteration RandomForest Lasso Ridge
# 1 1 0.18 0.06 0.06
# 2 2 0.15 0.07 0.07
# 3 3 0.15 -0.04 -0.06
","stringr23aphics
library(data.table)
library(plotly)
library(scales)
library(ggplot2)
library(scales)
library(d3heatmap)
library(reshape2)
library(scales)
library(stringr)
library(htmlwidgets)
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 20 columns, instead of 16. in line 4.
"","X","date","ippi","production","inventories","rea","wti","inflation","crude_futures_1","crude_futures_3","crude_futures_6","crude_futures_9","crude_futures_13","gas_spot","delta_ippi","delta_production","delta_inventories","delta_inflation","actual"
"14",14,"1991-03-01",116.2,233926,5.673,4.87,19.9015,134.8,19.809,19.075,18.7665,18.852,18.8205,0.72295,0.0157342657342656,0.114341925372637,-1.59229484234705,0.0531250000000001,19.9015
"15",15,"1991-04-01",116,225256,1.488,1.48,20.83,135.1,20.8122727272727,20.2840909090909,19.9122727272727,19.7618181818182,19.63,0.720045454545455,0.0157618213660244,-0.022470642353125,-0.952635599694423,0.0505443234836702,20.83
"16",16,"1991-05-01",116.5,229670,17.55,3.21,21.2322727272727,135.6,21.2195454545455,21.1459090909091,21.1195454545455,20.935,20.7909090909091,0.700954545454545,0.0210341805433831,0.0335485903291857,-48.0509383377953,0.051978277734678,21.2322727272727
"17",17,"1991-06-01",116.4,219610,-8.967,4.19,20.189,136,20.232,20.376,20.5405,20.2935,20.1795,0.6346,0.