Displaying 1 result from an estimated 1 matches for "numberarray".
2005 Aug 26
2
problem with certain data sets when using randomForest
...ss "a"
or "b" from the levels "a", "b" and "c" doesn't work
because there is no instance that has class "c". Is
there any way to solve this problem?
library("randomForest")
# load the iris plant data set
dataset <- iris
numberarray <- array(1:nrow(dataset), nrow(dataset),
1)
# include only instances with Species = setosa or
virginica
indices <- t(numberarray[(dataset$Species == "setosa"
|
dataset$Species == "virginica") == TRUE])
finaldataset <- dataset[indices,]
# just to let you see the 3 cl...