📜  binarizer pyspark - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:08.519000             🧑  作者: Mango

代码示例1
#Binarizer dat nguong dat co 0 va 1
from pyspark.ml.feature import Binarizer
df = df.withColumn("List_Day_of_Week",df["List_Day_of_Week"].cast("double"))
binarizer = Binarizer(threshold=5.0,inputCol="List_Day_of_Week",outputCol="Listed_On_Weekend")
df = binarizer.transform(df)