This file contains 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
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta name="generator" content="pandoc" /> |
This file contains 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(MASS) # load the MASS package | |
> height.response = na.omit(survey$Height) | |
> n = length(height.response) | |
> s = sd(height.response) # sample standard deviation | |
> SE = s/sqrt(n); SE # standard error estimate | |
[1] 0.6811677 | |
> | |
> print(paste("Standard Error:", SE)) | |
[1] "Standard Error: 0.68116773214787" | |
> |
This file contains 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
> system.time({ caret.model <- train(carat ~ depth + table + price + x + y + z, data=diamonds, distribution="gaussian", method="gbm", trControl = trainControl(method="none", number=1), tuneLength=1, verbose=FALSE)}) | |
user system elapsed | |
1.108 0.060 1.188 | |
> system.time({ model <- gbm(carat ~ depth + table + price + x + y + z, data=diamonds, distribution="gaussian")}) | |
user system elapsed | |
0.818 0.026 0.856 |
This file contains 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
print("start.207") | |
for (i in 1:5) { | |
t <- get(paste0("d", i)); | |
y <- factor(t[,c("start.207")], levels=c("1", "0")) | |
x <- t[,c("stop.165","stop.166","stop.167","stop.168","stop.169","stop.185", | |
"stop.186","stop.187","stop.188","stop.189","stop.205","stop.206", | |
"stop.207","stop.208","stop.209","stop.225","stop.226","stop.227", | |
"stop.228","stop.229","stop.245","stop.246","stop.247","stop.248","stop.249")] | |
md <- train(x, y, method="rf", ntree=ntrees, trControl=trainControl(method="cv")) |
This file contains 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
> install.packages("dplyr") | |
also installing the dependency ‘DBI’ | |
trying URL 'https://cran.rstudio.com/bin/macosx/mavericks/contrib/3.3/DBI_0.5-1.tgz' | |
Content type 'application/x-gzip' length 353669 bytes (345 KB) | |
================================================== | |
downloaded 345 KB | |
trying URL 'https://cran.rstudio.com/bin/macosx/mavericks/contrib/3.3/dplyr_0.5.0.tgz' | |
Content type 'application/x-gzip' length 4841443 bytes (4.6 MB) |
This file contains 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
> class(hash_table) | |
[1] "hash" | |
attr(,"package") | |
[1] "hash" | |
> str(hash_table) | |
Formal class 'hash' [package "hash"] with 1 slot | |
..@ .xData:<environment: 0x24f72ec8> | |
> object_size(hash_table) | |
type: 17 | |
Error: Unimplemented type |
This file contains 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
if (! "old_library" %in% ls()) { | |
old_library <- library | |
} | |
logging_library <- function(...) { | |
cat(as.character(substitute(...)), | |
sep="\n", | |
file="library_log.txt", | |
append=TRUE) | |
This file contains 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
#!/usr/bin/env perl | |
# | |
use warnings; | |
use strict; | |
use Data::Dumper; | |
use constant MY_CONSTANT => 13; | |
my %foo = (MY_CONSTANT => 'dingle'); |
This file contains 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
/** | |
* This function fetches a url and gets some of the instrumentation data. | |
* | |
* @param url the Url to fetch and instrument | |
* @return an object which contains the status code, latency, and contentLength. | |
*/ | |
function fetchUrl(url) { | |
try { | |
var start = new Date().getTime(); | |
var resp = UrlFetchApp.fetch(url); |
This file contains 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
#!/usr/bin/env perl | |
use warnings; | |
use strict; | |
use Data::Dumper; | |
my @records = (); | |
my $now = time(); | |
my $weeks = 604800 * 52; |