0

Similar to some of my other questions, I'm working on a FB Prophet model and want to hyperparameter tune the variables. I believe (testing) that I can loop through non-standard variables, by first assigning them to a variable in the grid.

It runs, but takes forever. Let it go for over 12 hours and it still wasn't done. Read that I could try and speed this up with Dask, but every time I run it, my computer just crashes. It's a decently equipped gaming desktop and I'm running the client locally, so I'm assuming there something in my Dask setup that isn't correct.

As an example, even running the first part of the code that creates the parameter grid crashes my computer:

if __name__ == '__main__':
    from dask.distributed import Client
    client = Client()

param_grid = {  
 
                'changepoint_prior_scale': [0.005, .01, 0.05, 0.5, 1, 5, 10, 20, 30, 40, 50, 60, 70, 80 ,90, 100],
                'changepoint_range': [0.8, 0.9],
                'seasonality_mode': ['multiplicative', 'additive'],
                'growth': ['linear', 'logistic'],
                'yearly_seasonality': [0.005, .01, 0.05, 0.5, 1, 5, 10, 20, 30, 40, 50, 60, 70, 80 ,90, 100],
                'weekly_seasonality': [0.005, .01, 0.05, 0.5, 1, 5, 10, 20, 30, 40, 50, 60, 70, 80 ,90, 100],
                'daily_seasonality': [0.005, .01, 0.05, 0.5, 1, 5, 10, 20, 30, 40, 50, 60, 70, 80 ,90, 100],
                'monthy_fourier': [0.005, .01, 0.05, 0.5, 1, 5, 10, 20, 30, 40, 50, 60, 70, 80 ,90, 100],
                'monthy_prior_scale': [0.005, .01, 0.05, 0.5, 1, 5, 10, 20, 30, 40, 50, 60, 70, 80 ,90, 100],
                'daily_fourier': [0.005, .01, 0.05, 0.5, 1, 5, 10, 20, 30, 40, 50, 60, 70, 80 ,90, 100],
                'daily_prior_scale': [0.005, .01, 0.05, 0.5, 1, 5, 10, 20, 30, 40, 50, 60, 70, 80 ,90, 100],
                'weekly_fourier': [0.005, .01, 0.05, 0.5, 1, 5, 10, 20, 30, 40, 50, 60, 70, 80 ,90, 100],
                'weekly_prior_scale': [0.005, .01, 0.05, 0.5, 1, 5, 10, 20, 30, 40, 50, 60, 70, 80 ,90, 100],
                'yearly_fourier': [0.005, .01, 0.05, 0.5, 1, 5, 10, 20, 30, 40, 50, 60, 70, 80 ,90, 100],
                'yearly_prior_scale': [0.005, .01, 0.05, 0.5, 1, 5, 10, 20, 30, 40, 50, 60, 70, 80 ,90, 100]
              }


# Generate all combinations of parameters
all_params = [dict(zip(param_grid.keys(), v)) for v in itertools.product(*param_grid.values())]
print(all_params)

What am I doing wrong?

t25
  • 167
  • 3
  • 14
  • you're not using `dask` here, you're just initializing it. does it crash at the initialization? – Nullman Nov 06 '21 at 22:39
  • I was just loosely following the prophet documentation. I figured that I was not doing something right. Weird part is, this is the only thing that I added and the script went from running (but forever) to crashing every time I run it. – t25 Nov 06 '21 at 22:41
  • it might be the default dask parameters, try `client = Client(processes=False, threads_per_worker=4, n_workers=1, memory_limit='2GB')` and also comment out `all_params = ...` and see if it still crashes. probably have task manager open on the performance tab and watch to see if something weird happans – Nullman Nov 06 '21 at 22:46
  • At that point, once I initiate the client, I'm assuming Dask is "on" and applies to all processes? Little hard to understand the documentation. I know you said I wasn't using it, but in most of the examples I have seen, they look like they just initiate the client and go. – t25 Nov 06 '21 at 22:50
  • dask does not monkey patch your whole system, you create a client that you then need to use. first though, lets figure out whats causing the crashes, please try what i told you and report back – Nullman Nov 06 '21 at 22:52
  • If I run that, no issues. I did find an issue with the rest of my script that was also causing it to fail, that has been resolved. Curious though as to how to apply Dask. I have 16 threads 32GB of memory (total) – t25 Nov 06 '21 at 22:56
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/238953/discussion-between-nullman-and-sccrbrg). – Nullman Nov 06 '21 at 22:57

0 Answers0