Predicting churn
In this exercise, you will use the predict() function in the pROC package to predict the churn probability of the customers in the test set, test_set.
The function has three arguments:
- The model used to make the predictions.
newdata: The dataset the model should be applied to.type: the type of prediction. We want to know the probability of churn, so we choose eitherresponseorprob.
Use the function predict() to predict the churn probability of the customers in test_set.
本练习是课程的一部分
Predictive Analytics using Networked Data in R
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Load the package
library(pROC)
# Predict with the first model
firstPredictions <- predict(___, newdata = test_set, type = "response")