Skip to content

Commit 5632cfc

Browse files
committed
Merge pull request scikit-learn#4818 from amueller/sgd_decision_function_deprecation
[MRG] Fix deprecation of decision function in SGD
2 parents 867da31 + 3be9b97 commit 5632cfc

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

sklearn/linear_model/stochastic_gradient.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,20 @@ def decision_function(self, X):
987987
----------
988988
X : {array-like, sparse matrix}, shape (n_samples, n_features)
989989
990+
Returns
991+
-------
992+
array, shape (n_samples,)
993+
Predicted target values per element in X.
994+
"""
995+
return self._decision_function(X)
996+
997+
def _decision_function(self, X):
998+
"""Predict using the linear model
999+
1000+
Parameters
1001+
----------
1002+
X : {array-like, sparse matrix}, shape (n_samples, n_features)
1003+
9901004
Returns
9911005
-------
9921006
array, shape (n_samples,)
@@ -1012,7 +1026,7 @@ def predict(self, X):
10121026
array, shape (n_samples,)
10131027
Predicted target values per element in X.
10141028
"""
1015-
return self.decision_function(X)
1029+
return self._decision_function(X)
10161030

10171031
def _fit_regressor(self, X, y, alpha, C, loss, learning_rate,
10181032
sample_weight, n_iter):

0 commit comments

Comments
 (0)