哪个函数用于 Sparks Mllib 中的预测

Which function is used for the prediction in Sparks Mllib

什么函数用于计算某个数据点的预测。考虑以下代码:

final LogisticRegressionModel model = logisticRegression.run(train.rdd());
point = train.rdd().take(0);
Double prediction = model.predict(point.features());

我以为会是

但是我找不到实现这个功能的文档。

它使用的是标准逻辑函数(你公式中的y不合适):

哪个is implemented as:

val margin = dot(weightMatrix, dataMatrix) + intercept
val score = 1.0 / (1.0 + math.exp(-margin))

要获得原始值,您应该clearThreshold