Repository navigation
Fix warnings emitted by the application scorecard full suite - #561
Merged
Merged
Conversation
- HyperParametersTuning: make_scorer(needs_proba=...) was removed in scikit-learn 1.6, so every recall scorer failed and GridSearchCV reported non-finite scores. Use response_method="predict_proba". - Test descriptions: round-trip params through NumpyEncoder so params holding DataFrames (fit_params eval_set) no longer fail JSON serialization, which fell back to the default description. - WeakspotsDiagnosis: copy the column slices before adding the bin column (SettingWithCopyWarning). - ScoreProbabilityAlignment: pass observed=True to groupby (pandas FutureWarning). - lending_club: silence scorecardpy's pandas FutureWarnings at its two call sites; they are third-party and hundreds of lines long in the notebook. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
|
Pull requests must include at least one of the required labels: |
make_scorer(response_method=...) exists from scikit-learn 1.4, the release that deprecated needs_proba. Make the floor explicit so an older environment fails at install time rather than with a TypeError at test time. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
|
Pull requests must include a description in the release notes section. |
2 similar comments
Contributor
|
Pull requests must include a description in the release notes section. |
Contributor
|
Pull requests must include a description in the release notes section. |
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.
Pull Request Description
What and why?
Running
application_scorecard_full_suite.ipynbon validmind 2.13.12 prints roughly 600 warning lines. This removes all of them except one template mismatch (see below).FutureWarning/UserWarning(pandas deprecations insidewoebin,woebin_ply,condition_fun)lending_club:warnings.catch_warnings()around the two scorecardpy calls. Third-party code, unmaintained upstream.TypeError: custom_recall() got an unexpected keyword argument 'needs_proba'plus sklearn "Scoring failed" / "non-finite test scores"HyperParametersTuning:make_scorer(..., response_method="predict_proba").needs_probawas removed in scikit-learn 1.6, so the recall scorer had been silently failing.response_methodexists from 1.4, sopyproject.tomlnow requiresscikit-learn>=1.4(base) and>=1.4,<1.8(extras).SettingWithCopyWarninginWeakspotsDiagnosis.copy()the column slices before assigning the bin column.FutureWarning: The default of observed=False is deprecatedinScoreProbabilityAlignmentgroupby(..., observed=True). Bins come fromqcut, so no empty categories are dropped.Failed to generate description for HyperParametersTuning: Object of type DataFrame is not JSON serializablegenerate_description: round-tripparamsthroughNumpyEncoderbefore the request. The demo config passesfit_params={"eval_set": [(x_test, y_test)]}.Not addressed:
Config key 'validmind.model_validation.ModelMetadata' does not match a test_id in the template. The demo config is shared by several notebooks and that test exists in other templates; the model's documentation template on the platform decides this.How to test
uv run python -m unittest tests.test_test_descriptions tests.unit_tests.model_validation.sklearn.test_WeakspotsDiagnosis— includes the newtest_generate_description_params_are_json_serializable._create_scoring_dict(["roc_auc", "recall"], ..., 0.3)fed toGridSearchCVon scikit-learn 1.7.2 returns finite recall and roc_auc scores.lending_club.feature_engineeringon a 5k-row sample of the offline dataset emits zero scorecardpy warnings in the parent process.What needs special review?
>=1.4matches the library's Python 3.9 minimum; the lock refresh only changed the three specifier lines.Dependencies, breaking changes, and deployment notes
Adds a lower bound
scikit-learn>=1.4(January 2024). Environments on older scikit-learn will now fail at install time rather than with aTypeErrorinHyperParametersTuning.Release notes
HyperParametersTuningrecall scoring on scikit-learn 1.6 and later; recall scores were reported as non-finite.HyperParametersTuningwithfit_params.WeakspotsDiagnosis,ScoreProbabilityAlignmentand thelending_clubdemo dataset.Checklist
🤖 Generated with Claude Code