[R] randomForest: more than one variable needed?

Hui Han hhan at cse.psu.edu
Tue Apr 13 17:15:39 CEST 2004


Hi,

I am doing feature selection for my dataset. The following is
the extreme case where only one feature is left. But I got
the error below. So my question is that do I have to use
more than one features?

sample.subset
  udomain.edu hpclass
1        -1.0     not
2        -1.0     not
3        -0.2     not
4         1.0      hp
5         1.0      hp
> randomForest(hpclass ~., data=sample.subset, importance=TRUE);
Error in if (n == 0) stop("data (x) has 0 rows") :
        argument is of length zero

Best regards,
Hui Han
Department of Computer Science and Engineering,
The Pennsylvania State University 
University Park, PA,16802
email: hhan at cse.psu.edu
homepage: http://www.cse.psu.edu/~hhan




More information about the R-help mailing list