A credit scorecard converts applicant characteristics into points. It maps features to bins, fits logistic regression on the bin IDs, and scales the output to a familiar range, such as 300–850. section 6.1.2
OptBinning automates numeric and categorical binning and can apply statistical constraints, such as minimum information value or maximum p-value. A fitted scorecard assigns points to bins, making contributions inspectable. section 6.1 section 6.1.2
Listing 6.3 Creating and fitting the scorecard
estimator = LogisticRegression(solver="lbfgs", max_iter=1000)
scorecard = Scorecard(
binning_process=binning_process,
estimator=estimator,
scaling_method="min_max",
scaling_method_params={"min": 300, "max": 850} # BFSI range
)
scorecard.fit(X, y)
print("Scorecard fitted on X, y.")
See the OptBinning setup for fitting logistic regression on binned features and scaling scores to 300–850. section 6.1.2
Inspect scorecard tables to validate contributions and support review:
- The summary table lists variables, bins, and points, helping identify disproportionate contributions. section 6.1.2
- The detailed table adds bin counts, event rates, WoE, IV, logistic coefficients, and assigned points. section 6.1.2
Listing 6.5 Viewing the detailed scorecard table
sc_detailed = scorecard.table(style="detailed") print(sc_detailed)
See the detailed-table call for inspecting bin-level statistics, coefficients, and points. section 6.1.2
Reviewing score contributions
If one variable contributes disproportionately to the score, revisit its binning logic or scaling parameters. Detailed bin statistics can also help identify unexpected coefficient jumps or investigate performance drops after deployment. section 6.1.2
