Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy import linalg | |
from sklearn.utils import array2d, as_float_array | |
from sklearn.base import TransformerMixin, BaseEstimator | |
class ZCA(BaseEstimator, TransformerMixin): | |
def __init__(self, regularization=10**-5, copy=False): | |
self.regularization = regularization |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sigmoid(X): | |
'''Compute the sigmoid function ''' | |
#d = zeros(shape=(X.shape)) | |
den = 1.0 + e ** (-1.0 * X) | |
d = 1.0 / den | |
return d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dplyr) | |
#train <- read.csv("train.csv") | |
test <- read.csv("test_v2.csv") | |
last_items <- test %.% | |
group_by(customer_ID) %.% | |
filter(shopping_pt==max(shopping_pt)) %.% | |
mutate(plan=paste(A,B,C,D,E,F,G,sep='')) %.% | |
select(customer_ID,plan) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Correlation matrix with p-values. See http://goo.gl/nahmV for documentation of this function | |
cor.prob <- function (X, dfr = nrow(X) - 2) { | |
R <- cor(X, use="pairwise.complete.obs") | |
above <- row(R) < col(R) | |
r2 <- R[above]^2 | |
Fstat <- r2 * dfr/(1 - r2) | |
R[above] <- 1 - pf(Fstat, 1, dfr) | |
R[row(R) == col(R)] <- NA | |
R | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# quick example of creating a plot like that at the link below | |
# http://www.visualisingdata.com/index.php/2015/01/make-grey-best-friend/ | |
x<-1:10 | |
y<-x^2 | |
z<-x | |
radius<-x/5 | |
dat<-data.frame(x=x, y=y, z=z, radius=radius) | |
ggplot(dat, aes(x,y))+ | |
geom_ribbon(aes(ymin=y-radius, ymax=y+radius), alpha=0.5, fill="grey", color="grey", size=1)+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
py_dict = readLines('python_dictionary.txt') | |
# e.g. | |
#{"cat_name": "Ella", "dwell_status": "tree_dweller", "coat_color": "gray, white, orange", "is_from_hell": "Y"} | |
#{"cat_name": "Billie", "dwell_status": "bush_dweller", "coat_color": "gray, white", "is_from_hell": "N"} | |
dict_to_df = function(dict) { | |
require(plyr) | |
df = data.frame() | |
df_temp = list() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Pavan Kumar Sunkara | |
email = [email protected] | |
[core] | |
editor = vim | |
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
excludesfile = ~/.gitignore | |
[sendemail] | |
smtpencryption = tls | |
smtpserver = smtp.gmail.com |
This gist provides sample code for using Nokia 5110 displays using the ATtiny85 template library. For a full description of code behind this please see this post on The Garage Lab website.
To use this sample code first clone the ATtiny85 template repository and then replace 'main.c' with the source provided here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Original code come from Adafruit GPS logger shield kit - v1.1 | |
http://www.adafruit.com/products/98 | |
http://www.ladyada.net/make/gpsshield/download.html | |
All of this example Arduino code is Public Domain. Enjoy! | |
http://en.wikipedia.org/wiki/GNU_General_Public_License | |
Modified by DWHacks for use with U-blox PCI-5S. | |
Info about U-blox PCI-5S here: http://emerythacks.blogspot.ca/2013/01/u-blox-pci-5s-cheap-gps-module-for-your.html |
OlderNewer