I hereby claim:
- I am frbl on github.
- I am frbl (https://keybase.io/frbl) on keybase.
- I have a public key whose fingerprint is 8756 D347 8013 8489 9210 FDD0 1BC7 5A3E 743F 90E1
To claim this, I am signing this object:
cat index.fdb_latexmk | grep .sty | awk -F' ' '{print $1}' | awk -F'"' '{print $2}' | xargs -J % cp % ~/test |
I hereby claim:
To claim this, I am signing this object:
data <- c(1,2,1,3,2,1,2,3) | |
intervals <- c(0.1, 0.3, 0.6,1) | |
runif(data, intervals[data], intervals[data+1]) | |
# Test if the output is correct: | |
check <- all(unlist(lapply(1:length(data), function(i) {res[i] >= intervals[data[i]] & res[i] <= intervals[data[i] + 1]}))) | |
expect_true(check) |
#!/usr/bin/env sh | |
lib_dir=~/.R/lib/notebooks | |
mkdir -p $lib_dir | |
`sleep 3; open http://127.0.0.1:8888` & | |
docker run --rm -it \ | |
-p 127.0.0.1:8888:8888 \ | |
-v `pwd`:/home/jovyan/work \ | |
-v $lib_dir:/usr/local/spark-2.1.0-bin-hadoop2.7/R/lib \ | |
frbl/docker-notebook \ | |
start-notebook.sh \ |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script> | |
</head> | |
<body> | |
<ul id='data'> | |
</ul> |
#!/usr/bin/env Rscript | |
## Constrained logistic regression | |
## In this gist we create a regression for which the predicted probabilities are contstrained. That is, they can not be | |
## less than a minimum of delta, or a maxiumum of 1 - delta. | |
## Based on: | |
## - https://stats.idre.ucla.edu/r/dae/logit-regression/ | |
## - https://github.com/achambaz/tsml.cara.rct/blob/2b2aa282d4a11c601b37cacb368b67d03f6e8fc9/R/misc.R#L440 | |
## - https://github.com/achambaz/tsml.cara.rct/blob/fd426c2a6f91b692d379b4765d9900151d09daa6/R/targetGstar.R#L1 |
Osample_p_full <- read.csv('http://frbl.eu/files/gist_ac602828fedba735b4d1e4cb16472cbe.csv') | |
formula <- Delta ~ W + A | |
glm_pred <- glm(formula = formula(formula), data = Osample_p_full, family= binomial()) | |
print(glm_pred) | |
# Call: glm(formula = formula(formula), family = binomial(), data = Osample_p_full) | |
# | |
# Coefficients: | |
# (Intercept) A W | |
# 18.378 -19.241 0.379 |
library(microbenchmark) | |
library(data.table) | |
rbindlist_time <- function() { | |
data <- data.table(a=c(1),b=c(2)) | |
for (item in 1:10000) { | |
data <- rbindlist(data, data.table(a=c(1),b=c(2))) | |
} | |
} |
set.seed(12345) | |
library('data.table') | |
library('xgboost') | |
## Create simulation function | |
give_me_data <- function(nobs, delta = 0.05) { | |
X_mat <- data.table(A = rnorm(nobs, 0, 1), B = rnorm(nobs, 0, 1)) | |
probs <- pmax(as.numeric(X_mat$A > 0) - 2*delta, 0) + delta | |
X_mat <- as.matrix(X_mat) | |
Y_vals <- rbinom(nobs, 1, probs) |
[connection] | |
id=eduroam | |
uuid=<THIS_CAN_BE_AUTOGENERATED> | |
type=wifi | |
permissions=user:<PC_USERNAME>:; | |
[wifi] | |
mac-address=<MACADDRESS_OF_YOUR_WLAN_CARD> | |
mac-address-blacklist= | |
mode=infrastructure |