sklearn.metrics.check_scoring?

sklearn.metrics.check_scoring(estimator, scoring=None, *, allow_none=False)

[源碼]

從用戶選項確定評分器。

如果無法對評估器進行評分,則將引發TypeError。

參數 說明
estimator estimator object implementing ‘fit’
用于擬合數據的對象。
scoring string, callable or None, optional, default: None
字符串(請參閱模型評估文檔)或帶有簽名scorer(estimator, X, y)的評分器可調用對象/函數。
allow_none boolean, optional, default: False
如果未指定任何評分并且估算器沒有評分函數,則可以返回None或引發異常。
返回值 說明
scoring callable
具有簽名scorer(estimator, X, y)的評分器可調用對象/函數。