user3111321
user3111321

Reputation: 55

What is the type="prob" in the predict function?

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

Answers (1)

Yilun Zhang
Yilun Zhang

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

Related Questions