<author>/<type>/<ticket>/<title>
revett/feature/24101/skeleton-service-for-email-sender
| dt_sequential <- function(tbl, group_by, fun, use_cols) { | |
| time_taken <- system.time({ | |
| res <- tbl[, fun(.SD), by = group_by, .SDcols = use_cols] | |
| }) | |
| list(result = res, timings = time_taken) | |
| } | 
| fastROC <- function(probs, class) { | |
| class_sorted <- class[order(probs, decreasing=T)] | |
| TPR <- cumsum(class_sorted) / sum(class) | |
| FPR <- cumsum(class_sorted == 0) / sum(class == 0) | |
| return(list(tpr=TPR, fpr=FPR)) | |
| } | |
| # Helpful function adapted from: https://stat.ethz.ch/pipermail/r-help/2005-September/079872.html | |
| fastAUC <- function(probs, class) { | |
| x <- probs | 
| sudo: required #is required to use docker service in travis | |
| language: php #can be any language, just php for example | |
| services: | |
| - docker # required, but travis uses older version of docker :( | |
| install: | |
| - echo "install nothing!" # put your normal pre-testing installs here | 
| require(caret) | |
| #load some data | |
| data(USArrests) | |
| ### Prepare Data (postive observations) | |
| # add a column to be the strata. In this case it is states, it can be sites, or other locations | |
| # the original data has 50 rows, so this adds a state label to 10 consecutive observations | |
| USArrests$state <- c(rep(c("PA","MD","DE","NY","NJ"), each = 5)) | |
| # this replaces the existing rownames (states) with a simple numerical index | 
| one <- seq(1:10) | |
| two <- rnorm(10) | |
| three <- runif(10, 1, 2) | |
| four <- -10:-1 | |
| df <- data.frame(one, two, three) | |
| df2 <- data.frame(one, two, three, four) | |
| str(df) | 
| max_plots <- 5 | |
| ui <- fluidPage( | |
| headerPanel("Dynamic number of plots"), | |
| sidebarPanel( | |
| sliderInput("n", "Number of plots", value=1, min=1, max=5) | |
| ), | 
As configured in my dotfiles.
start new:
tmux
start new with session name: