Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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)
 
PREVIOUS NEXT
Tagged: #OneHotEncoder #pyspark
ADD COMMENT
Topic
Name
1+1 =