Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

How to set the parameters of gbm boost in R

$
0
0

@pagal_guy wrote:

hello,

While trying to implement boosting in R using caret I used the following code:

library(ISLR);
data(Wage);
library(ggplot2);
library(caret);
Wage <- subset(Wage,select=-c(logwage))
inTrain <- createDataPartition(y=Wage$wage,p=0.7, list=FALSE)
training <- Wage[inTrain,]; testing <- Wage[-inTrain,]
#Fit the model:
modFit <- train(wage ~ ., method="gbm",data=training,verbose=FALSE)
print(modFit)

This gives an output:

Here some values like n.trees etc. are selected by default.
How do I set the values,for example I want to set n.trees = 500 etc.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles