我的目标是使用https://spark.apache.org/docs/2.0.2/api/java/org/apache/spark/mllib/stat/test/StudentTTest上记录的方法在 Spark Scala 中执行 t 检验.html。假设我的数据在数据框中给出:
val df = Seq((1, 3), (-2, 5), (0, 4), (3, -1), (2, -1)).toDF("group1", "group2")
现在,我试过了
import org.apache.spark.mllib.stat.test
val ttestResult = test.StudentTTest(df)
但这给了我一个错误:<console>:29: error: object StudentTTest in package test cannot be accessed in package org.apache.spark.mllib.stat.test
我究竟做错了什么?