I have a matrix about 37k x 1024 in size consisting of 1s and 0s as categorical variables indicating the existence or absence of a feature vector. I ran this matrix through the randomForest package in R as follows:
rfr <- randomForest(X_train,Y_train)
Where X_train is a matrix containing categorical variables, and Y__train is a vector consisting of labels for each row in the matrix. When I run this, I get the following error:
Error in y - ymean : non-numeric argument to binary operator
In addition: Warning message:
In mean.default(y) : argument is not numeric or logical: returning NA
I checked for any null values or missing data, but could not find them.
I even did it all in data.frame and tried the following
rfr <- randomForest(labels ~ ., data = featureDF)
All the same mistakes.
I would be grateful for any help with this, thanks!