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
# modification of https://gist.github.com/brendano/39760 | |
# automatically obtains data from the web | |
# creates two data frames, test and train | |
# labels are stored in the y variables of each data frame | |
# can easily train many models using formula `y ~ .` syntax | |
# download data from http://yann.lecun.com/exdb/mnist/ | |
download.file("http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz", | |
"train-images-idx3-ubyte.gz") | |
download.file("http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz", |
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
# S3 dispatch on more than one function argument. | |
f <- function(x, y) UseMethod("f") | |
f.numeric <- function(x, y) UseMethod("f.numeric", y) | |
f.numeric.numeric <- function(x, y) cat("Type <n,n>\n") | |
f.numeric.character <- function(x, y) cat("Type <n,c>\n") | |
f.character <- function(x, y) UseMethod("f.character", y) | |
f.character.character <- function(x, y) cat("Type <c,c>\n") | |
f.character.numeric <- function(x, y) cat("Type <c,n>\n") |
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
# -*- coding: utf-8 -*- | |
import getopt, sys | |
ALPH = "abcdefghijklmnopqrstuvwxyz" | |
SHORT_OPT = "a:b:i:c:" | |
LONG_OPT = ["account-number=","bank-number=", "iban=", "coutry-code="] | |
def country_code(c = "DE"): | |
f = c.lower()[0] |
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
row_vec <- function(x) { | |
n <- length(x) | |
matrix(x, nrow = 1, ncol = n) | |
} | |
col_vec <- function(x) { | |
n <- length(x) | |
matrix(x, nrow = n, ncol = 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
OPTS=--standalone | |
all: diff.pdf comments.md | |
diff: diff.pdf | |
comments.md: src.docx | |
pandoc $< -o $@ --track-changes=all $(OPTS) | |
acc.tex: src.docx |