且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

用于交叉验证模型的predict_proba

更新时间:2023-12-02 14:34:52

现在已作为scikit-learn版本0.18的一部分实现.您可以将方法"字符串参数传递给cross_val_predict方法.文档位于此处.

This is now implemented as part of scikit-learn version 0.18. You can pass a 'method' string parameter to the cross_val_predict method. Documentation is here.

示例:

proba = cross_val_predict(logreg, X, y, cv=cv, method='predict_proba')

还要注意,这是新的sklearn.model_selection包的一部分,因此您将需要此导入:

Also note that this is part of the new sklearn.model_selection package so you will need this import:

from sklearn.model_selection import cross_val_predict