create a random forest classifier
Usage
# S3 method for projector
rf_classifier(x, colind = NULL, labels, scores, ...)
Arguments
- x
the model object
- colind
the (optional) column indices used for prediction
- labels
A factor or vector of class labels for the training data.
- scores
a matrix of references scores used for classification
- ...
extra arguments to randomForest
function
Value
a rf_classifier
object
Examples
data(iris)
X <- iris[,1:4]
pcres <- pca(as.matrix(X),2)
cfier <- rf_classifier(pcres, labels=iris[,5], scores=scores(pcres))
p <- predict(cfier, new_data=as.matrix(iris[,1:4]))
#> Error in predict.rf_classifier(cfier, new_data = as.matrix(iris[, 1:4])): object 'obj' not found