เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Split the data

Now that you've done all your manipulations, the last step before modeling is to split the data!

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Foundations of PySpark

ดูคอร์ส

คำแนะนำการฝึกหัด

  • Use the DataFrame method .randomSplit() to split piped_data into two pieces, training with 60% of the data, and test with 40% of the data by passing the list [.6, .4] to the .randomSplit() method.

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Split the data into training and test sets
training, test = piped_data.randomSplit(____)
แก้ไขและรันโค้ด