O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running the predict() function

Next, we will use the predict() function to score the test data in ChurnStudy.test, based upon the prediction model trained on ChurnStudy. The newdata= label designates the new dataset to be stored. The lp type is one of several types used for prediction, and this method uses the linear predictor:

pred_validation <- predict(CoxModel.1, newdata=ChurnStudy.test, type='lp')

The resulting predictions will be in log form.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required