My name is Abhi and I am trying to understand the difference between predict and prediction.
I am using the r language and my ide is rstudio. I have created a random forest model (r package randomForest)
myModel <- randomForest(Survived ~ .,data = modelData[,-1],importance = T) modelResponses = predict(model,type = "prob") # I am guessing this gives probability of survival for each passenger temp1 = modelResponses[,2] pred = prediction(temp1,trainData$Survived) #Not Sure whats is the pred object
Now here are my questions
- What is the pred object?
- I have seen some code which uses the pred object to plot the auc curve. I know temp1 is the probability of survival for each record. Say the probability of survival for a particular record is 0.55. How does the prediction function know to classify this as survived or not-survived?
- How do I use this model to classify new data. Until now I was using
modelResponses = predict(model,type = "prob"), but now I am not so sure. Again the same confusion as item 2, how does the system determine the best cut off point for probabilities.
Thanks a lot guys. Any help would be much appreciated.