Destination
Now you'll encode the dest column just like you did in the previous exercise.
Это упражнение является частью курса
Foundations of PySpark
Инструкции к упражнению
- Create a
StringIndexercalleddest_indexerby callingStringIndexer()withinputCol="dest"andoutputCol="dest_index". - Create a
OneHotEncodercalleddest_encoderby callingOneHotEncoder()withinputCol="dest_index"andoutputCol="dest_fact".
Интерактивное практическое упражнение
Попробуйте выполнить это упражнение, дополнив этот пример кода.
# Create a StringIndexer
dest_indexer = ____
# Create a OneHotEncoder
dest_encoder = ____