I get two different performance metrics when I run this code two times in a row? and I'm not sure I understand why this is happening as I'm using the same training and testing set. I'm setting the seed in the beginning as well.
set.seed(42)
data(BostonHousing, package = "mlbench")
regr.task = makeRegrTask(id = "bh", data = BostonHousing, target = "medv")
lrn = makeLearner("regr.ctree")
outer=makeResampleInstance(makeResampleDesc("Holdout"),task=regr.task)
r = resample(
learner = lrn,
task = regr.task,
resampling = outer,
show.info = TRUE
)
This is what I get running the code the first time:
Resampling: holdout
Measures: mse
[Resample] iter 1: 20.5713143
Aggregated Result: mse.test.mean=20.5713143
This is what I get running the code the second time:
Resampling: holdout
Measures: mse
[Resample] iter 1: 21.9437349
Aggregated Result: mse.test.mean=21.9437349