MCPcopy
hub / github.com/scikit-learn/scikit-learn / _predict_binary

Function _predict_binary

sklearn/multiclass.py:106–115  ·  view source on GitHub ↗

Make predictions using a single binary estimator.

(estimator, X)

Source from the content-addressed store, hash-verified

104
105
106def _predict_binary(estimator, X):
107 """Make predictions using a single binary estimator."""
108 if is_regressor(estimator):
109 return estimator.predict(X)
110 try:
111 score = np.ravel(estimator.decision_function(X))
112 except (AttributeError, NotImplementedError):
113 # probabilities of the positive class
114 score = estimator.predict_proba(X)[:, 1]
115 return score
116
117
118def _threshold_for_binary_predict(estimator):

Callers 3

predictMethod · 0.85
decision_functionMethod · 0.85
predictMethod · 0.85

Calls 4

is_regressorFunction · 0.90
predictMethod · 0.45
decision_functionMethod · 0.45
predict_probaMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…