Skip to content

Conversation

@dswah
Copy link
Owner

@dswah dswah commented Jul 16, 2019

for large search-spaces, gridsearch can easily exhaust all available memory before fitting a single model.
This is because the method tries to pre-determine the entire search space in memory.

we could instead use a generator like itertools.product

this fixes #242

TO-DO

  • tests
  • remove all references to pygam.utils.combine

Repository owner deleted a comment from codecov bot Nov 18, 2025
@dswah
Copy link
Owner Author

dswah commented Nov 18, 2025

@fkiraly we've been getting lots of failures on setup in macos and windows like this: https://github.com/dswah/pyGAM/actions/runs/19465120143/job/55698192192

they all complain about codecov.
I tried moving the codecov section to the end of the CI yml, and now everything passes....
Do you think this is ok?

@fkiraly
Copy link
Collaborator

fkiraly commented Nov 19, 2025

Honestly, I have no idea what is going on with codecov, or why moving it to the end would change anything - sorry. Do the search engines or AIs say anything useful about these errors?
Maybe the codecov service is down?


# loop through candidate model params
for param_grid in pbar(param_grid_list):
for grid in pbar(product(*grids), max_value=grid_size):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it might be beneficial to parallelize this for loop? I can create an issue/PR if that might be interesting.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ankurankan I think that would be great!
Do you think it will run faster?

I have never been very good art parallelizing numerical python routines. My parallel routines always seem to run just as fast/slow as my serial ones...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can give it a quick try and share some benchmarks. Let's see if that improves anything. Have created an issue: #406

@dswah dswah changed the title replace combine with itertools product [BUG] replace combine with itertools product Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Grid search increasing memory usage

4 participants