2016-09-18 8 views
0

特定のデータポイントの予測を計算するために使用される関数は何ですか?Sparks Mllibの予測に使用される関数

enter image description here

ことが、私は思っ

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

はあるだろうが、私はこの機能を実装してドキュメントを見つけることができませんでした。次のコードを考えてみましょう。

答えて

3
それは(あなたの式では場違いであるY )標準ロジスティック関数使用している

enter image description here

is implemented as

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

すると、あなたがclearThresholdをすべき生の値を取得するには。

+0

ありがとうございます。だから私はほぼ正しいです。 –

関連する問題