I hereby claim:
- I am devmacrile on github.
- I am devmacrile (https://keybase.io/devmacrile) on keybase.
- I have a public key whose fingerprint is 08D8 CCCC 5D01 1F96 285C 2606 7709 364D 9CCA 6F14
To claim this, I am signing this object:
# Wrapper function for the Sentiment140 API | |
# An API for a maximum entropy model trained on ~1.5M tweets | |
# The server will timeout if the job takes > 60 seconds, | |
# so if the tweet count is relatively high, the function | |
# will split the data into chunks of 2500 (fairly arbitrary choice) | |
# http://help.sentiment140.com/api | |
Sentiment140 <- function(sentences){ | |
# Load required packages | |
library(plyr) |
# Example of a common cross-validation mistake | |
# Described in The Elements of Statistical Learning, 7.10.2 | |
# http://statweb.stanford.edu/~tibs/ElemStatLearn/ | |
# | |
# Consider a scenario with | |
# N = 50 samples in two equal-sized classes, and p = 5000 quantitative | |
# predictors (standard Gaussian) that are independent of the class labels. | |
# The true (test) error rate of any classifier is 50%. We carried out the above | |
# recipe, choosing in step (1) the 100 predictors having highest correlation | |
# with the class labels, and then using a 1-nearest neighbor classifier, based |
#!/usr/bin/python | |
import sys | |
import re | |
import nltk | |
from nltk.corpus import stopwords | |
stop_words = stopwords.words('english') | |
#input comes from standard input | |
for line in sys.stdin: | |
#separate incident id from text |
# Write R data.frame to a Tableau data extract file (.tde) by building and executing | |
# a python script which utilizes the Tableau data extract API (a hack, yes). | |
# | |
# This, naturally, has a hard dependency on the TDE API, so is only available for | |
# Windows and Linux systems (unfortunately) | |
# | |
# Devin Riley | |
# October, 2014 |
I hereby claim:
To claim this, I am signing this object:
import numpy as np | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
di1 = np.random.random_integers(1, 20, 100000) | |
di2 = np.random.random_integers(1, 20, 100000) | |
values = (di1 + di2) - (np.absolute(di1 - di2)) | |
sample_mean = np.nanmean(values) |
#(let ((a 1)) | |
# (define (f x) | |
# (define b (+ a x)) | |
# (define a 5) | |
# (+ a b)) | |
# (f 10)) | |
a = 1 | |
def f(x): |