I am working on some ML algorithms on the classic Iris dataset. This is my code:
library(tidyverse)
library(caret)
dataset <- iris
tt_index <- createDataPartition(dataset$Sepal.Length, times = 1, p = 0.9, list = FALSE)
train_set <- dataset[tt_index, ]
test_set <- dataset[-tt_index, ]
model_glm <- train(Species ~.,
data = train_set,
method = "gbm")
My problem is that complex methods like gbm
show the iteration text information, like this:
Iter TrainDeviance ValidDeviance StepSize Improve
1 1.0986 nan 0.1000 0.3942
2 0.8415 nan 0.1000 0.2644
3 0.6641 nan 0.1000 0.1963
4 0.5333 nan 0.1000 0.1489
5 0.4325 nan 0.1000 0.1091
I tried to use suppressWarnings
and suppressMessages
functions but the iteration information text still appears.
suppressMessages(model_glm <- train(Species ~.,
data = train_set,
method = "gbm"))
Please, do you know how to avoid that information text? Any help will be greatly appreciated.