Apache Spark是否提供API來獲取類似於scikit-learn的predict_proba函數(即decision_tree.predict_proba(X))的決策樹預測概率?Spark - Prediction Probability API(predict_proba)
3
A
回答
-1
1
我自己尋找這一點。當我注意到api具有非常尷尬的功能時(至少對於LogisticRegressionModel
),我差點破解了一個解決方案:
您清除了閾值(使用clearThreshold()
)。這樣預測功能不會返回標籤,而是返回底層的價值。
Java docs這樣說:
公共LogisticRegressionModel clearThreshold() ::實驗::清除閾值,使得預測將要輸出的原始預測分數。
僅供參考:返回值介於0和1之間,默認閾值爲0.5,因此您可以輕鬆評估要設置閾值的內容。
相關問題
- 1. 情緒分析Google Prediction API
- 2. Google API密鑰是否適用於Prediction API?
- 3. Sklearn - predict_proba等效
- 4. TypeError for predict_proba(np.array(test))
- 5. 關於Branch Prediction of i7
- 6. Google Prediction API總是返回1.0或0.0的分數
- 7. 執行Google Prediction API命令行時出錯示例
- 8. 在Google App Engine之外使用Google Prediction API?
- 9. Google Apps腳本上的Google Prediction API的最新版本請
- 10. AlamoFire請求Google Cloud Prediction API iOS解析錯誤
- 11. 與谷歌應用程序引擎谷歌Prediction API進行
- 12. Keras - predict_proba不加起來1?
- 13. 迴歸與分類器predict_proba
- 14. 始終概率:predict_proba,sklearn
- 15. Spark Streaming Statistics的API
- 16. spark將spark-SQL轉換爲RDD API
- 17. scikit-learn/svm - 在'predict_proba'後獲取概率和相關標籤
- 18. Spark寫DataFrame出jdbc錯誤
- 19. 閱讀和學習Spark API?
- 20. Spark Datastax Java API Select語句
- 21. 使用spark-kernel comm API
- 22. 如何擴展apache spark api?
- 23. Spark數據集API - 加入
- 24. Spark-Streaming Kafka Direct Streaming API&Parallelism
- 25. SVM python中predict_proba的提取概率
- 26. Keras分類器predict_proba()不符合預測()
- 27. 獲取對應的類predict_proba(GridSearchCV sklearn)
- 28. TensorFlow Estimator 1.3無法獲得predict_proba?
- 29. RandomForestClassifier(sklearn)的predict_proba(X)似乎是靜態的?
- 30. 將自定義字段添加到Spark ML LabeldPoint
謝謝。我只能看到得到布爾預測的能力,而不是預測概率。我錯過了什麼嗎? – user2701815 2014-12-19 20:25:40