neuralforecast icon indicating copy to clipboard operation
neuralforecast copied to clipboard

points_to_evaluate parameter

Open candalfigomoro opened this issue 1 year ago • 3 comments

In ray.tune, with some algorithms, you can suggest starting points for optimization (if you already have some decent hyperparameters).

E.g. see the "points_to_evaluate" parameter in https://docs.ray.io/en/latest/tune/api/doc/ray.tune.search.hyperopt.HyperOptSearch.html

Is there a way to provide "points_to_evaluate" to the Auto* classes in neuralforecast? This can be useful if you previously run an Auto* model (e.g. AutoNHITS) and you want to suggest the best points of the previous run to the new Auto* run.

candalfigomoro avatar Apr 16 '23 17:04 candalfigomoro

hey @candalfigomoro! Thanks for using neuralforecast.

The Auto classes receive a parameter called search_alg which receives a ray.tune.search.searcher.Searcher class. So, you can instantiate the HyperOptSearch class with your parameters and pass it to the Auto class, for example:

hyperopt_alg = HyperOptSearch(points_to_evaluate=...)
models = [AutoNHITS(..., search_alg=hyperopt_alg)]
nf = NeuralForecast(models=models, freq="M")
nf.fit(Y_df)

AzulGarza avatar Apr 17 '23 22:04 AzulGarza

Thanks @FedericoGarza!

In that case, should I also provide the search space through the space parameter of the HyperOptSearch class or should I keep using the config parameter of the AutoNHITS class?

candalfigomoro avatar Apr 18 '23 06:04 candalfigomoro

Hi @candalfigomoro. We have a tutorial on how to use HyperOptSearch in https://nixtla.github.io/neuralforecast/examples/automatic_hyperparameter_tuning.html

cchallu avatar Jun 06 '23 22:06 cchallu