%% Display Unscaled Points
% This example shows how to use displaypoints after a model is fitted to compute the unscaled points per bin, for a given predictor in the creditscorecard model.
% 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);

%
% Display unscaled points for predictors retained in the fitting model.

PointsInfo = displaypoints(sc)

% displaypoints always displays a '<missing>' bin for each predictor. The value of the '<missing>' bin comes from the initial creditscorecard object, and the '<missing>' bin is set to NaN whenever the scorecard model has no information on how to assign points to missing data.
% To configure the points for the '<missing>' bin, you must use the initial creditscorecard object. For predictors that have missing values in the training set, the points for the '<missing>' bin are estimated from the data if the 'BinMissingData' name-value pair argument is set to true using creditscorecard. When the 'BinMissingData' parameter is set to false, or when the data contains no missing values in the training set, use the 'Missing' name-value pair argument in formatpoints to indicate how to assign points to the missing data.
% Copyright 2015 The MathWorks, Inc.