fix: pass run_main/vacant/hedonic/ensemble flags through finalize_models#314
Open
drussellmrichie wants to merge 1 commit intolarsiusprime:masterfrom
Open
Conversation
finalize_models() accepted no model-type flags and hardcoded run_main=True, run_vacant=True, run_hedonic=True, run_ensemble=True in its internal call to benchmark.run_models(). This means callers that disable certain model types in settings.json (e.g. run_vacant: false, run_hedonic: false) would still trigger those model types during finalize_models, leading to crashes when no sales data exists for those types (empty LightGBM validation set). The fix adds run_main, run_vacant, run_hedonic, run_ensemble keyword arguments to finalize_models with the same defaults as before (all True), and passes them through to benchmark.run_models. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
Thank you for your contribution. I affirm that this contributor has signed the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
finalize_models()accepted no model-type flags and hardcodedrun_main=True,run_vacant=True,run_hedonic=True,run_ensemble=Truein its internal call tobenchmark.run_models().This means callers that disable certain model types (e.g.
run_vacant=False,run_hedonic=False) would still trigger those model types duringfinalize_models, causing crashes when no sales data exists for those types -- specifically aValueError: Input data must be 2 dimensional and non emptyfrom LightGBM when the validation set is empty.Note that
try_models()already accepts and passes through these flags correctly;finalize_models()was inconsistent.Fix
Add
run_main,run_vacant,run_hedonic,run_ensemblekeyword arguments tofinalize_modelswith the same defaults as before (allTrue), and pass them through tobenchmark.run_models. The docstring is updated accordingly.