You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Method qrf in caret gives slightly random results (noise) with the same seed set. Expected would be exactly the same result for multiple runs.
# load caret and DT the cars data set
require(caret); require(DT); require(mlbench);
library(AppliedPredictiveModeling)
data(solubility)
# load the data and coerce into single frame (legacy)training_data=data.frame(solTrainX,solTrainY)[1:20,]
testing_data=data.frame(solTestX,solTestY)
# just rename columsn to stay conform with style below
colnames(training_data)[colnames(training_data) =='solTrainY'] <-'y'
colnames(testing_data)[colnames(testing_data) =='solTestY'] <-'y'# all the training data (just named x and y)y<-training_data$yx<-training_data[, -ncol(training_data)]
# load all libraries
library(doParallel); cl<- makeCluster(8); registerDoParallel(cl)
# RMSE and R2 results should be the same, three times
set.seed(123); result<- train(x,y,"qrf"); getTrainPerf(result)
set.seed(123); result<- train(x,y,"qrf"); getTrainPerf(result)
set.seed(123); result<- train(x,y,"qrf"); getTrainPerf(result)
# stop the parallel processing and register sequential front-end
stopCluster(cl); registerDoSEQ();
Random results (noise?):
># RMSE and R2 results should be the same, three times> set.seed(123); result<- train(x,y,"qrf"); getTrainPerf(result)
TrainRMSETrainRsquaredmethod10.075204210.2510523qrf> set.seed(123); result<- train(x,y,"qrf"); getTrainPerf(result)
TrainRMSETrainRsquaredmethod10.075718080.2133274qrf> set.seed(123); result<- train(x,y,"qrf"); getTrainPerf(result)
TrainRMSETrainRsquaredmethod10.075852810.23388qrf
Method qrf in caret gives slightly random results (noise) with the same seed set. Expected would be exactly the same result for multiple runs.
Random results (noise?):
Expected results as example with "knn"
This may be a result of the "randomness" in the forest. Nomen est omen. Maybe a feature not a bug.
The text was updated successfully, but these errors were encountered: