Answers for "OneHotEncoder pyspark"

0

OneHotEncoder pyspark

from pyspark.ml.feature import OneHotEncoder,StringIndexer
encodeer = OneHotEncoder(inputCol="City_Index",outputCol="City_Vec")
encodeer_df = encodeer.fit(indexed).transform(indexed)
encodeer_df["City_Index","City_Vec"].show(5)
Posted by: Guest on September-19-2021

Python Answers by Framework

Browse Popular Code Answers by Language