Evaluate the model
Remember the test data that you set aside waaaaaay back in chapter 3? It's finally time to test your model on it! You can use the same evaluator you made to fit the model.
This exercise is part of the course
Foundations of PySpark
Exercise instructions
- Use your model to generate predictions by applying
best_lr.transform()
to thetest
data. Save this astest_results
. - Call
evaluator.evaluate()
ontest_results
to compute the AUC. Print the output.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Use the model to predict the test set
test_results = best_lr.____(____)
# Evaluate the predictions
print(evaluator.evaluate(____))