Add missing metric config to sweep example in credit scorecards notebook#632
Open
johndmulhausen wants to merge 1 commit into
Open
Add missing metric config to sweep example in credit scorecards notebook#632johndmulhausen wants to merge 1 commit into
johndmulhausen wants to merge 1 commit into
Conversation
The sweep_config in the XGBoost credit scorecards notebook had no "metric" key, so W&B sweep visualizations picked an arbitrary parameter as the optimization goal. Add the metric block pointing at val_log_loss (minimize), which matches what the sweep train() function logs via run.summary["val_log_loss"]. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds the missing W&B sweep metric configuration to the Credit Scorecards hyperparameter sweep example so the sweep correctly optimizes validation log loss (instead of defaulting to an arbitrary parameter).
Changes:
- Inserted a
"metric"block intosweep_configwithname: "val_log_loss"andgoal: "minimize".
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
johndmulhausen
marked this pull request as ready for review
July 21, 2026 21:33
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.
Bug
The
sweep_configincolabs/boosting/Credit_Scorecards_with_XGBoost_and_W&B.ipynbdefinesmethodandparametersbut nometrickey. Without it, W&B sweep visualizations (parallel coordinates, parameter importance, best-run selection) pick an arbitrary parameter as the optimization goal instead of the validation loss the notebook actually cares about.Fix
Insert a
metricblock intosweep_config, right aftermethod:val_log_lossmatches exactly what the sweep'strain()function records (run.summary["val_log_loss"]), and it is a mean negative log-likelihood, sominimizeis the correct goal. The block matches the cell's existing indentation and spacing style, and the change is a pure 4-line insertion in the raw notebook JSON — no other cells, outputs, or metadata touched.Verification
nbformat.validate()passes on the edited notebook (still valid nbformat 4 JSON).wandb.sweep(...)call) and executed it: it is valid Python andsweep_config["metric"] == {"name": "val_log_loss", "goal": "minimize"}.train()cell (the function passed towandb.agent) still logsrun.summary["val_log_loss"], so the metric name matches what training logs.Fixes #601
🤖 Generated with Claude Code