2

Our team run the following code to create a random forest model and train it:

# Define a cross validation strategy
rdesc <- makeResampleDesc("CV", iters = cv_fold, predict = "both")

# Define a (regression) task
task_01 = makeRegrTask(data = data.model, target = "target_actual")

# Make a learner
lrn_rf = makeLearner("regr.randomForestSRC", predict.type = "response",
                     fix.factors.prediction = TRUE,
                     par.vals = list(nodesize = 50, mtry = 36, ntree = 500))

set.seed(7)
model_rf = mlr::resample(lrn_rf, task_01, rdesc, models = TRUE, 
                         extract = function(x) getLearnerModel(x),
                         measures = list(rmse, rsq), show.info = FALSE)

model_rf

Mostly, the model predicts coherent results that make sense. However, when I run exactly the same code (no changes whatsoever) on the computers of two of my colleagues, the model predicts those weird results:

Resample Result
Task: data.model
Learner: regr.randomForestSRC
Aggr perf: rmse.test.rmse=361.1464455,rsq.test.mean=-588.1729057
Runtime: 4.0032

What could be the reason for this weird behavior on only two computers but not the other ones?

Jan Janiszewski
  • 432
  • 3
  • 14

1 Answers1

0

This was a version conflict. After installing an older version of randomForestSRC, it all worked on my computer as well.

It definitely did not work with randomForestSRC version: 2.6.0

It definitely works now with randomForestSRC version: 2.5.1

Jan Janiszewski
  • 432
  • 3
  • 14