Repository navigation
DOC better doc for SGDClassifier.partial_fit - #12767
qinhanmin2014 merged 5 commits into
Conversation
|
|
||
| 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. Objective convergence and callbacks such as early stopping |
There was a problem hiding this comment.
What do you mean by callbacks here? I think callbacks have a specific meaning (at least in my mind) and I don't remember supporting them or having them here. You could say "Matters such as objective convergence or early stopping should be handled by the user.", or similar, I guess.
There was a problem hiding this comment.
A standard definition for callbacks are functions you call periodically during the training procedure. early_stopping fits into this definition. But scikit-learn does not support user-defined callbacks, so using this term may be misleading. Is it what you had in mind?
f2a216f to
cb9e1d1
Compare
|
|
||
| def partial_fit(self, X, y, classes=None, sample_weight=None): | ||
| """Fit linear model with Stochastic Gradient Descent. | ||
| """Carry out stochastic gradient descent on one pass of X, y. |
There was a problem hiding this comment.
Let's rephrase this a little:
"Perform one epoch of stochastic gradient descent on the given samples"
WDYT?
There was a problem hiding this comment.
Sounds good.
Edit: actually, this sentence is 1 character too long. "On the given X, y"?
qinhanmin2014
left a comment
There was a problem hiding this comment.
LGTM, thanks @pierreglaser
)" This reverts commit 48c5806.
)" This reverts commit 48c5806.
I found that the doc of
SGDClassifierlittle bit unclear: it does not say explicitly that only one pass overXis carried out. This is what we would expect for a stochastic gradient object, but in other places ofscikit-learn,partial_fithas a different meaning than this one.