%% Compute Probability for Default Using Credit ScoreCard Data
% Create a creditscorecard object using the CreditCardData.mat file to load the data (using a dataset from Refaat 2011).

load CreditCardData
sc = creditscorecard(data,'IDVar','CustID')

%
% Perform automatic binning using the default options. By default, autobinning uses the Monotone algorithm.

sc = autobinning(sc);

%
% Fit the model.

sc = fitmodel(sc);

%
% Compute the probability of default.

pd = probdefault(sc);
disp(pd(1:15,:))

% Copyright 2015 The MathWorks, Inc.