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
mosh --ssh="/usr/bin/ssh -i ./spot.pem" [email protected] --server="/usr/bin/mosh-server" |
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
install.packages("devtools") | |
devtools::install_github("slowkow/ggrepel") |
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
install.packages(c('shinyIncubator','markdown','whisker','Hmisc','qcc','httr','RCurl','curl','devtools'), repos='http://cran.rstudio.com/') | |
devtools::install_github("ropensci/ckanr") | |
ckanr::ckanr_setup(url="http://catalogue-beta.data.wa.gov.au/") |
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
mkdir -p /var/projects/rstudio-server | |
docker run -d \ | |
-p 8787:8787 \ | |
-e USER=<username> \ | |
-e PASSWORD=<password> \ | |
-v /var/projects/rstudio-server/:/home/ \ | |
rocker/ropensci |
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
sudo docker run -it --device /dev/nvidiactl --device /dev/nvidia-uvm --device /dev/nvidia0 kaixhin/cuda-mxnet:7.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
""" Amazon Access Challenge Starter Code | |
These files provide some starter code using | |
the scikit-learn library. It provides some examples on how | |
to design a simple algorithm, including pre-processing, | |
training a logistic regression classifier on the data, | |
assess its performance through cross-validation and some | |
pointers on where to go next. | |
Paul Duan <[email protected]> |
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
# Do bagging | |
tmpP = rep(0,nrow(test)) | |
for (j in 1:30) { | |
set.seed(j+200) | |
print(j) | |
bst = xgb.train(param=param, data=xgtrain, nrounds=1200) | |
tmpP = tmpP + predict(bst,xgtest) | |
} |
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
train$month <- as.integer(format(train$Original_Quote_Date, "%m")) | |
train$year <- as.integer(format(train$Original_Quote_Date, "%y")) | |
train$day <- weekdays(as.Date(train$Original_Quote_Date)) |
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
impute.med <- function(x) replace(x, is.na(x), median(x, na.rm = TRUE)) | |
df_all <- sapply(df_all, function(x){ | |
if(is.numeric(x)){ | |
impute.med(x) | |
} else { | |
x | |
} | |
} | |
) |
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
# To do it for all names | |
col_names <- names(df_all) | |
# do do it for some names in a vector named 'col_names' | |
df_all[,col_names] <- lapply(df_all[,col_names] , factor) |