As configured in my dotfiles.
start new:
tmux
start new with session name:
As configured in my dotfiles.
start new:
tmux
start new with session name:
Mute these words in your settings here: https://twitter.com/settings/muted_keywords | |
ActivityTweet | |
generic_activity_highlights | |
generic_activity_momentsbreaking | |
RankedOrganicTweet | |
suggest_activity | |
suggest_activity_feed | |
suggest_activity_highlights | |
suggest_activity_tweet |
import multiprocessing | |
# split a list into evenly sized chunks | |
def chunks(l, n): | |
return [l[i:i+n] for i in range(0, len(l), n)] | |
def do_job(job_id, data_slice): | |
for item in data_slice: | |
print "job", job_id, item |
library(dplyr) | |
library(tidyr) | |
library(magrittr) | |
library(ggplot2) | |
"http://academic.udayton.edu/kissock/http/Weather/gsod95-current/NYNEWYOR.txt" %>% | |
read.table() %>% data.frame %>% tbl_df -> data | |
names(data) <- c("month", "day", "year", "temp") | |
data %>% | |
group_by(year, month) %>% |
import os | |
import numpy | |
from pandas import DataFrame | |
from sklearn.feature_extraction.text import CountVectorizer | |
from sklearn.naive_bayes import MultinomialNB | |
from sklearn.pipeline import Pipeline | |
from sklearn.cross_validation import KFold | |
from sklearn.metrics import confusion_matrix, f1_score | |
NEWLINE = '\n' |
#' @title PRESS | |
#' @author Thomas Hopper | |
#' @description Returns the PRESS statistic (predictive residual sum of squares). | |
#' Useful for evaluating predictive power of regression models. | |
#' @param linear.model A linear regression model (class 'lm'). Required. | |
#' | |
PRESS <- function(linear.model) { | |
#' calculate the predictive residuals | |
pr <- residuals(linear.model)/(1-lm.influence(linear.model)$hat) | |
#' calculate the PRESS |
def calc_lift(x,y,clf,bins=10): | |
""" | |
Takes input arrays and trained SkLearn Classifier and returns a Pandas | |
DataFrame with the average lift generated by the model in each bin | |
Parameters | |
------------------- | |
x: Numpy array or Pandas Dataframe with shape = [n_samples, n_features] | |
y: A 1-d Numpy array or Pandas Series with shape = [n_samples] |
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
import re | |
import sys | |
def c(i): | |
""" |