You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Incremental should have a max_iter hyperparameter to control the number of passes (epochs) over the training data.
Implementing a max_iter is relatively straightforward. What we really want is some kind of "as many epochs as necessary until the underlying estimator has converged" parameter, which seems relatively difficult.
On Mon, Jul 2, 2018 at 5:23 PM, Tom Augspurger ***@***.***> wrote:
Incremental should have a max_iter hyperparameter to control the number
of passes (epochs) over the training data.
Implementing a max_iter is relatively straightforward. What we really
want is some kind of "as many epochs as necessary until the underlying
estimator has converged" parameter, which seems relatively difficult.
Split from #258 <#258>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#264>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AASszKPwsWVwrtByo9UalJmPxL3RR3XOks5uCo9FgaJpZM4U_9iu>
.
@ogrisel suggested that it might make sense to score frequently and then have some sort of patience parameter that tells us to stop training after our score has not improved on a validation set.
The partial_fit will not provide convergence checks by it-self. However, it would be great to replicate the convergence checks similarly to what is done in: scikit-learn/scikit-learn#9043
That is, set n_iter_no_change=5, tol=1e-3, max_iter=1000, validation_split=0.1 as default values in Incremental.
If validation_split=None, then disable the convergence check and ensure you reach max_iter for instance.
Or alternatively, one could also use a subsample of the training set if not validation_split is passed. In scikit-learn we have an early_stopping=True/False flag to switch from validation vs training set based convergence check but I am not a big fan of the name of that switch.
Making it possible for the user to explicitly pass a pair of (X, y) dask arrays (or just a single X dask array for unsupervised models such as Minibatch K-Means) is also an option. Maybe this should be a validation_data=(X, y) fit-params rather than a constructor param in that case.
For stopping conditions it seems like there are two options:
Use dask.delayed with a large graph of size max_iter and pass through a sentinel value if we should complete early. We'll still run all of the tasks, but the latter part of them will run very quickly.
This is nice because it uses only the local scheduler but introduces some overhead with very many tasks.
Use dask.distributed and the concurrent.futures interface. We would submit a few extra tasks to lead the computation, but would collect scores as they complete and not start any more computation if the stopping condition is met.
This is nice because it is more efficient and dynamic, but introduces a requirement on the distributed scheduler
It would be moderate effort. Probably a 2-3 weeks from someone who has
worked on the local scheduler before.
If that's the route that we go then I would suggest that we implement this
with the distributed scheduler today and then hope that the work above
happens in the future.
Also, client = Client(processes=False) is pretty lightweight. We're adding
tornado and msgpack, but not much else.
Making it possible for the user to explicitly pass a pair of (X, y) dask arrays (or just a single X dask array for unsupervised models such as Minibatch K-Means) is also an option. Maybe this should be a validation_data=(X, y) fit-params rather than a constructor param in that case.
Are we likely to want to score against large data, or if given a dask array should we assume that it is small enough to fit in memory and test against it with normal scikit-learn scorers
If we're using the concurrent.futures API then I'm inclined to implement this with common machinery for RandomSearchCV and HyperBand. See comment in #288 (comment)
Activity
mrocklin commentedon Jul 2, 2018
mrocklin commentedon Jul 12, 2018
@ogrisel suggested that it might make sense to score frequently and then have some sort of patience parameter that tells us to stop training after our score has not improved on a validation set.
TomAugspurger commentedon Jul 12, 2018
Yes, he mentioned that to me as well. Thanks for capturing it.
Should this validation set be provided by the user, or should
Xandybe split internal toIncremental?mrocklin commentedon Jul 12, 2018
ogrisel commentedon Jul 12, 2018
The
partial_fitwill not provide convergence checks by it-self. However, it would be great to replicate the convergence checks similarly to what is done in: scikit-learn/scikit-learn#9043That is, set
n_iter_no_change=5,tol=1e-3,max_iter=1000, validation_split=0.1as default values inIncremental.If
validation_split=None, then disable the convergence check and ensure you reachmax_iterfor instance.ogrisel commentedon Jul 12, 2018
Or alternatively, one could also use a subsample of the training set if not
validation_splitis passed. In scikit-learn we have anearly_stopping=True/Falseflag to switch from validation vs training set based convergence check but I am not a big fan of the name of that switch.ogrisel commentedon Jul 12, 2018
Making it possible for the user to explicitly pass a pair of
(X, y)dask arrays (or just a singleXdask array for unsupervised models such as Minibatch K-Means) is also an option. Maybe this should be avalidation_data=(X, y)fit-params rather than a constructor param in that case.mrocklin commentedon Jul 16, 2018
For stopping conditions it seems like there are two options:
Use dask.delayed with a large graph of size
max_iterand pass through a sentinel value if we should complete early. We'll still run all of the tasks, but the latter part of them will run very quickly.This is nice because it uses only the local scheduler but introduces some overhead with very many tasks.
Use dask.distributed and the concurrent.futures interface. We would submit a few extra tasks to lead the computation, but would collect scores as they complete and not start any more computation if the stopping condition is met.
This is nice because it is more efficient and dynamic, but introduces a requirement on the distributed scheduler
ogrisel commentedon Jul 16, 2018
Do you think it would be a huge effort to augment the local thread/process based scheduler with the
ClientAPI of the distributed scheduler?mrocklin commentedon Jul 16, 2018
mrocklin commentedon Jul 16, 2018
Are we likely to want to score against large data, or if given a dask array should we assume that it is small enough to fit in memory and test against it with normal scikit-learn scorers
mrocklin commentedon Jul 16, 2018
If we're using the concurrent.futures API then I'm inclined to implement this with common machinery for RandomSearchCV and HyperBand. See comment in #288 (comment)