Displaying 1 result from an estimated 1 matches for "rf_orig".
Did you mean:
cr4_orig
2009 Dec 10
2
different randomForest performance for same data
...erform different.
Why???
Here is my code:
> library(randomForest)
> load("datasets.RData") # import traindat and testdat
> nlevels(traindat$predictor1)
[1] 20
> nlevels(testdat$predictor1)
[1] 19
> nrow(traindat)
[1] 9838
> nrow(testdat)
[1] 3841
> set.seed(10)
> rf_orig <- randomForest(x=traindat[,-1], y=traindat[,1], xtest=testdat[,-1], ytest=testdat[,1],ntree=100)
> data.frame(rf_orig$test$err.rate)[100,1] # Error on test-dataset
[1] 0.3082531
# assign the levels of the training dataset th the test dataset for predictor 1
> levels(testdat$predicto...