【发布时间】:2015-01-26 05:34:57
【问题描述】:
我开始使用 spark,特别是 mllib 库。其中一些函数的范围和私有语句受到限制。如何在我的代码中使用这些函数? 例子: KMeans.scala
private[mllib] def pointCost(
centers: TraversableOnce[BreezeVectorWithNorm],
point: BreezeVectorWithNorm): Double =
findClosest(centers, point)._2
如果我创建一个扩展 kmeans 的类并尝试使用此函数,我将无法访问它。显示以下错误:
error: method MethodInClassKMeans in class KMeans cannot be accessed in myClass
谁能给我一些如何解决这个问题的例子? 谢谢和问候
【问题讨论】:
标签: scala apache-spark cluster-analysis private apache-spark-mllib