【发布时间】:2020-07-18 05:40:24
【问题描述】:
我有一个包含多个分类列的数据框。我正在尝试使用两列之间的内置函数查找卡方统计信息:
from pyspark.ml.stat import ChiSquareTest
r = ChiSquareTest.test(df, 'feature1', 'feature2')
但是,它给了我错误:
IllegalArgumentException: 'requirement failed: Column feature1 must be of type struct<type:tinyint,size:int,indices:array<int>,values:array<double>> but was actually double.'
feature1 的数据类型是:
feature1: double (nullable = true)
你能帮我解决这个问题吗?
【问题讨论】:
标签: apache-spark pyspark apache-spark-ml