IniziaInizia gratis

Split the data

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

Questo esercizio fa parte del corso

Foundations of PySpark

Visualizza il corso

Istruzioni dell'esercizio

  • 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.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Split the data into training and test sets
training, test = piped_data.randomSplit(____)
Modifica ed esegui il codice