Reputation: 55
Type parameter of the predict() function
What does the type="prob" argument in the predict function do? My is a sample of my code:
rf <- randomForest( Creditability ~. , data=train)
rf2 <- randomForest( Creditability ~. , data=train2)
prediction <- predict(rf, test)
prob_prediction <- predict(rf,test,type="prob")
prediction2 <- predict(rf2, test2)
Upvotes: 1
Views: 11265
Reputation: 9018
According to the documentation (http://ugrad.stat.ubc.ca/R/library/randomForest/html/predict.randomForest.html):
type: one of response, prob. or votes, indicating the type of output: predicted values, matrix of class probabilities, or matrix of vote counts. class is allowed, but automatically converted to "response", for backward compatibility.
Upvotes: 2