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.
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Foundations of PySpark
คำแนะนำการฝึกหัด
- Use your model to generate predictions by applying
best_lr.transform()to thetestdata. Save this astest_results. - Call
evaluator.evaluate()ontest_resultsto compute the AUC. Print the output.
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Use the model to predict the test set
test_results = best_lr.____(____)
# Evaluate the predictions
print(evaluator.evaluate(____))