7
我收到以下錯誤試圖建立一個ML Pipeline
:如何將ArrayType轉換爲PySpark DataFrame中的DenseVector?
pyspark.sql.utils.IllegalArgumentException: 'requirement failed: Column features must be of type [email protected] but was actually ArrayType(DoubleType,true).'
我features
列包含浮點值的數組。這聽起來像我需要將這些轉換爲某種類型的矢量(它不稀疏,所以DenseVector?)。有沒有辦法直接在DataFrame上執行此操作,還是需要將其轉換爲RDD?