如何解决火花“错误:缺少参数类型”中的错误

时间:2018-09-07 00:39:15

标签: apache-spark

我在scala学习火花

scala> val labeledPoints = selectedDataDF.map{row =>
     |   LabeledPoint(row.getDouble(0),
     |       Vectors.dense(
     |           row.getDouble(1),
     |           row.getDouble(2),
     |           row.getDouble(3)))
     | }
labeledPoints:org.apache.spark.sql.Dataset[org.apache.spark.mllib.regression.LabeledPoint] = [label: double, features: vector]

scala> import org.apache.spark.mllib.feature.StandardScaler
import org.apache.spark.mllib.feature.StandardScaler

scala> val scaler = new StandardScaler(withMean = true, withStd = true).fit(
    |     labeledPoints.map(x => x.features))
<console>:60: error: missing parameter type
           labeledPoints.map(x => x.features))
                             ^

如何解决此错误?为什么会出现此问题?

0 个答案:

没有答案