%% Display Points After Modifying Bin Labels
% This example shows how to use displaypoints after a model is fitted and the modifybins function is used to provide user-defined bin labels for a numeric predictor.
% Create a creditscorecard object using the CreditCardData.mat file to load the data (using a dataset from Refaat 2011). Use the 'IDVar' argument in the creditscorecard function to indicate that 'CustID' contains ID information and should not be included as a predictor variable.

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

%
% Perform automatic binning to bin for all predictors.

sc = autobinning(sc);

%
% Fit a linear regression model using default parameters.

sc = fitmodel(sc);

%
% Use the displaypoints function to display point information.

[PointsInfo,MinScore,MaxScore] = displaypoints(sc)

%
% Use the modifybins function to specify user-defined bin labels for 'CustAge' so that the bin ranges are described in natural language.

labels = {'Up to 32','33 to 36','37 to 39','40 to 45','46 to 47','48 to 57','At least 58'};
sc = modifybins(sc,'CustAge','BinLabels',labels);

%
% Rerun displaypoints to verify the updated bin labels.

[PointsInfo,MinScore,MaxScore] = displaypoints(sc)

% Copyright 2015 The MathWorks, Inc.