You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@since('0.9.0')
def predict(self, x):
"""
Predict values for a single data point or an RDD of points
using the model trained.
"""
if isinstance(x, RDD):
return x.map(lambda v: self.predict(v))
x = _convert_to_vector(x)
margin = self.weights.dot(x) + self.intercept
if self._threshold is None:
return margin
else:
return 1 if margin > self._threshold else 0
不知道如何输出指导书中的原始预测值,是将threshold置None了吗先?
The text was updated successfully, but these errors were encountered:
提供的源代码中GetPoint函数如下,注释说返回的是预测得分。
结合后续的scoreAndLabels推测,这里输出的应该是(预测得分,原始标签),并且指导书中也给出了输出样例:
但是,当指定了threshold后(默认-90000),
model.predict
返回的应该是预测的0-1值,如下:不知道如何输出指导书中的原始预测值,是将threshold置None了吗先?
The text was updated successfully, but these errors were encountered: