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 splitpiped_datainto two pieces,trainingwith 60% of the data, andtestwith 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(____)