TuneSearchCV vs Tune.run

How is TuneSearchCV different from Tune.run? They’re using the same algorithm. For example,

search_alg = HyperOptSearch()

experiment_1 = tune.run(
    trainable,
    search_alg=search_alg)

and

hyperopt_tune_search = TuneSearchCV(SGDClassifier(),
    param_distributions=param_dists,
    n_trials=2,
    early_stopping=True, # uses Async HyperBand if set to True
    max_iters=10,
    search_optimization="hyperopt"
)

hyperopt_tune_search.fit(X_train, y_train)

Please explain. Thanks in advance!

TuneSearchCV uses tune.run underneath the hood.

TuneSearchCV will also use Ray’s object store to avoid excessive memory usage when training on the dataset.

The big difference really is API. you can use arbitrary scikit-learn tools (like cross validation or pipelines) with TuneSearchCV, which may not be that easy to do with tune.run

So, TuneSearchCV is recommended over tune.run in case of sklearn classifiers?

Also, does it store checkpoints like tune.run and also for views on Tensorboard?

Thanks!

Yep!

You can pass in a logger like TuneSearchCV(loggers=..) and for checkpoints, I think so? though it’d be nice to doublecheck this. You should receive the best parameters, so refitting shouldn’t be too bad.

Thanks for the prompt response.
I’m looking at this documentation and wondering about using GPUs for tuning.

https://docs.ray.io/en/latest/tune/api_docs/sklearn.html?highlight=TuneSearchCV#tunesearchcv

I know that sklearn classifiers are not developed for GPUs but does this parameter help during training? in anyway?
use_gpu=True

Nope, though you might be able to use one of the cuML implementations.

1 Like