Destination
Now you'll encode the dest column just like you did in the previous exercise.
Latihan ini adalah bagian dari kursus
Foundations of PySpark
Petunjuk latihan
- Create a
StringIndexercalleddest_indexerby callingStringIndexer()withinputCol="dest"andoutputCol="dest_index". - Create a
OneHotEncodercalleddest_encoderby callingOneHotEncoder()withinputCol="dest_index"andoutputCol="dest_fact".
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
# Create a StringIndexer
dest_indexer = ____
# Create a OneHotEncoder
dest_encoder = ____