Skip to content

Commit

Permalink
DOC better doc for SGDClassifier.partial_fit (scikit-learn#12767)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierreglaser authored and qinhanmin2014 committed Feb 8, 2019
1 parent 0e3bb17 commit fcf7fc0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions sklearn/linear_model/stochastic_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,12 @@ def _fit_multiclass(self, X, y, alpha, C, learning_rate,
self.intercept_ = self.standard_intercept_

def partial_fit(self, X, y, classes=None, sample_weight=None):
"""Fit linear model with Stochastic Gradient Descent.
"""Perform one epoch of stochastic gradient descent on given samples.
Internally, this method uses ``max_iter = 1``. Therefore, it is not
guaranteed that a minimum of the cost function is reached after calling
it once. Matters such as objective convergence and early stopping
should be handled by the user.
Parameters
----------
Expand Down Expand Up @@ -1158,7 +1163,12 @@ def _partial_fit(self, X, y, alpha, C, loss, learning_rate,
return self

def partial_fit(self, X, y, sample_weight=None):
"""Fit linear model with Stochastic Gradient Descent.
"""Perform one epoch of stochastic gradient descent on given samples.
Internally, this method uses ``max_iter = 1``. Therefore, it is not
guaranteed that a minimum of the cost function is reached after calling
it once. Matters such as objective convergence and early stopping
should be handled by the user.
Parameters
----------
Expand Down

0 comments on commit fcf7fc0

Please sign in to comment.