Displaying 1 result from an estimated 1 matches for "rf_mod".
Did you mean:
ref_mod
2009 Dec 10
2
different randomForest performance for same data
...the levels of the training dataset th the test dataset for predictor 1
> levels(testdat$predictor1) <- levels(traindat$predictor1)
> nlevels(traindat$predictor1)
[1] 20
> nlevels(testdat$predictor1)
[1] 20
> nrow(traindat)
[1] 9838
> nrow(testdat)
[1] 3841
> set.seed(10)
> rf_mod <- randomForest(x=traindat[,-1], y=traindat[,1], xtest=testdat[,-1], ytest=testdat[,1],ntree=100)
> data.frame(rf_mod$test$err.rate)[100,1] # Error on test-dataset
[1] 0.4808644 # is different
Cheers,
TIM