-
Notifications
You must be signed in to change notification settings - Fork 76
[BUG] XGBoostLSS dynamic dependencies: add optuna to python_dependencies when n_trials != 0
#643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] XGBoostLSS dynamic dependencies: add optuna to python_dependencies when n_trials != 0
#643
Conversation
- Modified XGBoostLSS.__init__ to dynamically add optuna to python_dependencies when n_trials != 0 - This ensures proper dependency checking when hyperparameter optimization is enabled - Added .venv/ to .gitignore
XGBoostLSS dynamic dependencies: add optuna to python_dependencies when n_trials != 0
fkiraly
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Kindly simplify, see above.
fkiraly
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
the failure comes from an oversight in VM testing that does not take into account that more dependencies may need to be installed than in the class tag. I have to think about how to resolve this, but it is not an issue for your PR. |
Summary
This PR fixes an issue where
XGBoostLSSrequiresoptunawhenn_trials != 0for hyperparameter optimization, but the dependency was not properly declared in thepython_dependenciestag.Depends on #681 for testing.
Changes
XGBoostLSS.__init__: Added logic to dynamically includeoptunainpython_dependencieswhenn_trials != 0Problem
When
n_trialsis set to a non-zero value,XGBoostLSSuses hyperparameter optimization via the_hyper_optmethod, which requiresoptuna. However, thepython_dependenciestag only includedxgboostlss, causing dependency checking to fail whenoptunawas not installed.Solution
The fix dynamically updates the
python_dependenciestag at the end of__init__:n_trials == 0: Onlyxgboostlssis required (no hyperparameter optimization)n_trials != 0: Bothxgboostlssandoptunaare required (hyperparameter optimization enabled)This ensures the dependency checking system properly validates and installs
optunawhen needed, without removing test coverage.