## Using GBM in R  # install “gbm” & "readr"library(readr)library(gbm)   train <- read_csv("../input/training.csv")  str(train)# The terms below are omitted to avoid failing the agreement test# Remove some columns to pass the teststrain[,"id"] <- NULLtrain[,"IPSig"] <- NULLtrain[,"mass"] <- NULLtrain[,"production"] <- NULLtrain[,"min_ANNmuon"] <- NULLtrain[,"SPDhits"] <- NULLsummary(train)# Run GMB Generalized Boosted Regression Modelsm <- gbm(signal ~ . , distribution="bernoulli", data=train, n.trees=500, interaction.depth=6, n.minobsinnode=10, shrinkage=0.1, bag.fraction=0.5, train.fraction=1, verbose=TRUE)summary(m)# load test file test <- read_csv("../input/test.csv")# The terms below are omitted to avoid failing the agreement test# Remove some columns to pass the teststest[,"mass"] <- NULLtest[,"IPSig"] <- NULLtest[,"production"] <- NULLtest[,"min_ANNmuon"] <- NULLtest[,"SPDhits"] <- NULL# make prediction and write submission yp <- predict(m, type="response", newdata=test, n.trees=300)  sub <- data.frame(id=test$id, prediction=yp) summary(sub) write.csv(sub, "submissionGBM.csv", quote=F, row.names=F)