%% Perform Automatic Binning Using Two Name-Value Pair Arguments
% Create a creditscorecard object using the CreditCardData.mat file to load the data (using a dataset from Refaat 2011).

load CreditCardData 
sc = creditscorecard(data);

%
% Perform automatic binning for the predictor CustIncome using the Monotone algorithm with the initial number of bins set to 20. This example explicitly sets both the Algorithm and the AlgorithmOptions name-value arguments.

AlgoOptions = {'InitialNumBins',20}; 
sc = autobinning(sc,'CustIncome','Algorithm','Monotone','AlgorithmOptions',...
     AlgoOptions);

%
% Use bininfo to display the binned data. Here, the cut points, which delimit the bins, are also displayed.

[bi,cp] = bininfo(sc,'CustIncome')

% Copyright 2015 The MathWorks, Inc.