## ------------------------------------------------
## Method `RFTrainer$new`
## ------------------------------------------------
data("iris")
bst <- RFTrainer$new(n_estimators=10,
max_depth=4,
classification=1,
seed=42,
verbose=TRUE)
## ------------------------------------------------
## Method `RFTrainer$fit`
## ------------------------------------------------
data("iris")
bst <- RFTrainer$new(n_estimators=10,
max_depth=4,
classification=1,
seed=42,
verbose=TRUE)
bst$fit(iris, 'Species')
## ------------------------------------------------
## Method `RFTrainer$predict`
## ------------------------------------------------
data("iris")
bst <- RFTrainer$new(n_estimators=10,
max_depth=4,
classification=1,
seed=42,
verbose=TRUE)
bst$fit(iris, 'Species')
predictions <- bst$predict(iris)
## ------------------------------------------------
## Method `RFTrainer$get_importance`
## ------------------------------------------------
data("iris")
bst <- RFTrainer$new(n_estimators=50,
max_depth=4,
classification=1,
seed=42,
verbose=TRUE)
bst$fit(iris, 'Species')
predictions <- bst$predict(iris)
bst$get_importance()
Run the code above in your browser using DataLab