Skip to content

Commit 3be9b97

Browse files
committed
Fix deprecation of decision function in SGD
1 parent 867da31 commit 3be9b97

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy