Destination
Now you'll encode the dest column just like you did in the previous exercise.
Questo esercizio fa parte del corso
Foundations of PySpark
Istruzioni dell'esercizio
- Create a
StringIndexercalleddest_indexerby callingStringIndexer()withinputCol="dest"andoutputCol="dest_index". - Create a
OneHotEncodercalleddest_encoderby callingOneHotEncoder()withinputCol="dest_index"andoutputCol="dest_fact".
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
# Create a StringIndexer
dest_indexer = ____
# Create a OneHotEncoder
dest_encoder = ____