Merged
Conversation
Add ScoreCard.card2pmml() method to export scorecard rules to PMML format, enabling deployment in Java/PMML ecosystems. This addresses the feature request from PR #124 with a cleaner implementation. Changes: - Add _build_numeric_expression() helper for ExpressionTransformer - Add card2pmml() method using sklearn2pmml pipeline - Add requirements-pmml.txt with sklearn2pmml/sklearn-pandas deps - Add [pmml] optional dependency group in pyproject.toml - Add comprehensive unit tests and integration tests (with skip guards) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the empty-rules guard before the lazy import block so test_card2pmml_missing_rules works even when sklearn2pmml is not installed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
ScoreCard.card2pmml()method to export scorecard rules to PMML format for deployment in Java/PMML ecosystems_build_numeric_expression()helper for building nested if-else expressions used byExpressionTransformer[pmml]optional dependency group (sklearn2pmml,sklearn-pandas)Closes #124 — implements the same feature with a cleaner approach:
fit()on random data — directly sets sklearn attributeselsegroup handling viaself.ELSE_GROUPpip install toad[pmml]error messageTest plan
test_build_numeric_expression_*,test_card2pmml_missing_rules,test_card2pmml_import_error)sklearn2pmml/sklearn-pandas/Java not available🤖 Generated with Claude Code