Skip to content

Multiple epochs for Incremental #264

Open

Description

@TomAugspurger

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

Activity

  1. mrocklin commented on Jul 2, 2018

    @mrocklin
    Member
  2. mrocklin commented on Jul 12, 2018

    @mrocklin
    Member

    @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.

  3. TomAugspurger commented on Jul 12, 2018

    @TomAugspurger
    MemberAuthor

    Yes, he mentioned that to me as well. Thanks for capturing it.

    not improved on a validation set

    Should this validation set be provided by the user, or should X and y be split internal to Incremental?

  4. mrocklin commented on Jul 12, 2018

    @mrocklin
    Member
  5. ogrisel commented on Jul 12, 2018

    @ogrisel

    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.

  6. ogrisel commented on Jul 12, 2018

    @ogrisel

    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.

  7. ogrisel commented on Jul 12, 2018

    @ogrisel

    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.

  8. mrocklin commented on Jul 16, 2018

    @mrocklin
    Member

    For stopping conditions it seems like there are two options:

    1. 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.

    2. 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

  9. ogrisel commented on Jul 16, 2018

    @ogrisel

    Do you think it would be a huge effort to augment the local thread/process based scheduler with the Client API of the distributed scheduler?

  10. mrocklin commented on Jul 16, 2018

    @mrocklin
    Member
  11. mrocklin commented on Jul 16, 2018

    @mrocklin
    Member

    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

  12. mrocklin commented on Jul 16, 2018

    @mrocklin
    Member

    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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions