ScorecardHistogram

Creates histograms of credit scores, from both default and non-default instances, generated by a credit-risk model.

Purpose: The Scorecard Histogram test metric provides a visual interpretation of the credit scores generated by a machine learning model for credit-risk classification tasks. It aims to compare the alignment of the model’s scoring decisions with the actual outcomes of credit loan applications. It helps in identifying potential discrepancies between the model’s predictions and real-world risk levels.

Test Mechanism: This metric uses logistic regression to generate a histogram of credit scores for both default (negative class) and non-default (positive class) instances. Using both training and test datasets, the metric calculates the credit score of each instance with a scorecard method, considering the impact of different features on the likelihood of default. İncludes the default point to odds (PDO) scaling factor and predefined target score and odds settings. Histograms for training and test sets are computed and plotted separately to offer insights into the model’s generalizability to unseen data.

Signs of High Risk: - Discrepancies between the distributions of training and testing data, indicating a model’s poor generalisation ability - Skewed distributions favouring specific scores or classes, representing potential bias

Strengths: - Provides a visual interpretation of the model’s credit scoring system, enhancing comprehension of model behavior - Enables a direct comparison between actual and predicted scores for both training and testing data - Its intuitive visualization helps understand the model’s ability to differentiate between positive and negative classes - Can unveil patterns or anomalies not easily discerned through numerical metrics alone

Limitations: - Despite its value for visual interpretation, it doesn’t quantify the performance of the model, and therefore may lack precision for thorough model evaluation - The quality of input data can strongly influence the metric, as bias or noise in the data will affect both the score calculation and resultant histogram - Its specificity to credit scoring models limits its applicability across a wider variety of machine learning tasks and models - The metric’s effectiveness is somewhat tied to the subjective interpretation of the analyst, since it relies on the analyst’s judgment of the characteristics and implications of the plot.