Random Forrest Training Doubt

r
machine_learning
random_forest

#1

Hi,
I am training my model using below syntax but code is taking infinite time, Please suggest

set.seed(1238)
my_control = trainControl(method=“cv”, number=5) # 5-fold CV
tgrid = expand.grid(
.mtry = c(3:10),
.splitrule = “variance”,
.min.node.size = c(10,15,20)
)

rf_mod = train(x = Train[, -c(1,2)],
y = Train$Item_Outlet_Sales,
method=‘ranger’,
trControl= my_control,
tuneGrid = tgrid,
num.trees = 400,
importance = “permutation”)


#2

Hi @v.vicky000 reduce num.trees to 4 from 400 and rerun the code. Increase the no. of trees (num.trees) gradually.