# Optimal seasonality (frequency) value for Holt-Winters in time series prediction [duplicate]

I am trying to use Holt-Winters method in order to do time-series prediction on some datasets. The problem that I'm dealing with is the fact that each dataset has different seasonality value (or frequency basically). As an example, in one dataset the trend occurs every 300 timesteps while for another one this might be a different number. Assuming that I do not have the option of visualizing data each time to find out about the seasonality of my data, what would be the best way for finding the optimal value of frequency to get the best performance from Holt-Winters? Note that I receive about 500 out of 4000 samples to train my model.

My approach: Split train data to train and validation subsets. Use different seasonality values on train and evaluate performance on validation. For now, I think I'll use random search to find the best value such that it minimizes the prediction error on validation set. I was wondering if there are any other practical methods or approaches that any of you might be aware of?

UPDATE: I have to mention that I have to implement this only in python and not R, so the findfrequency() function from forecast package is applicable here.