fitmodel

Syntax

Description

sc = fitmodel(sc)
fits a logistic regression model to the Weight of Evidence (WOE) data and stores
the model predictor names and corresponding coefficients in the
creditscorecard object.

fitmodel internally transforms all the predictor variables
into WOE values, using the bins found with the automatic or manual binning
process. The response variable is mapped so that "Good" is 1,
and "Bad" is 0. This implies that higher (unscaled) scores
correspond to better (less risky) individuals (smaller probability of
default).

Alternatively, you can use setmodel to provide names of
the predictors that you want in the logistic regression model, along with their
corresponding coefficients.

[sc,mdl]
= fitmodel(sc)
fits a logistic regression model to the Weight of Evidence (WOE) data and stores
the model predictor names and corresponding coefficients in the
creditscorecard object. fitmodel
returns an updated creditscorecard object and a
GeneralizedLinearModel object containing the fitted
model.

fitmodel internally transforms all the predictor variables
into WOE values, using the bins found with the automatic or manual binning
process. The response variable is mapped so that "Good" is 1,
and "Bad" is 0. This implies that higher (unscaled) scores
correspond to better (less risky) individuals (smaller probability of
default).

Alternatively, you can use setmodel to provide names of
the predictors that you want in the logistic regression model, along with their
corresponding coefficients.

[sc,mdl]
= fitmodel(___,Name,Value)
fits a logistic regression model to the Weight of Evidence (WOE) data using
optional name-value pair arguments and stores the model predictor names and
corresponding coefficients in the creditscorecard object.
Using name-value pair arguments, you can select which Generalized Linear Model
to fit the data. fitmodel returns an updated
creditscorecard object and a
GeneralizedLinearModel object containing the fitted
model.

Use fitmodel to fit a logistic regression model using Weight of Evidence (WOE) data. fitmodel internally transforms all the predictor variables into WOE values, using the bins found with the automatic binning process. fitmodel then fits a logistic regression model using a stepwise method (by default).

Use fitmodel to fit a logistic regression model using Weight of Evidence (WOE) data. fitmodel internally transforms all the predictor variables into WOE values, using the bins found with the automatic binning process. fitmodel then fits a logistic regression model using a stepwise method (by default). When the optional name-value pair argument 'WeightsVar' is used to specify observation (sample) weights, the mdl output uses the weighted counts with stepwiseglm and fitglm.

Use fitmodel to fit a logistic regression model using Weight of Evidence (WOE) data. fitmodel internally transforms all the predictor variables into WOE values, using the bins found with the automatic binning process. Set the VariableSelection name-value pair argument to FullModel to specify that all predictors must be included in the fitted logistic regression model.

Use fitmodel to fit a logistic regression model using Weight of Evidence (WOE) data. fitmodel internally transforms all the predictor variables into WOE values, using the bins found with the automatic binning process. fitmodel then fits a logistic regression model using a stepwise method (by default). For predictors that have missing data, there is an explicit <missing> bin, with a corresponding WOE value computed from the data. When using fitmodel, the corresponding WOE value for the <missing> bin is applied when performing the WOE transformation. For example, a missing value for customer age (CustAge) is replaced with -0.15787 which is the WOE value for the <missing> bin for the CustAge predictor. However, when 'BinMissingData' is false, a missing value for CustAge remains as missing (NaN) when applying the WOE transformation.

Input Arguments

sc — Credit scorecard modelcreditscorecard object

Credit scorecard model, specified as a
creditscorecard object. Use creditscorecard to create
a creditscorecard object.

Name-Value Pair Arguments

Specify optional
comma-separated pairs of Name,Value arguments. Name is
the argument name and Value is the corresponding value.
Name must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN.

Predictor variables for fitting the
creditscorecard object, specified as the
comma-separated pair consisting of 'PredictorVars'
and a cell array of character vectors. When provided, the
creditscorecard object property
PredictorsVars is updated. Note that the order of
predictors in the original dataset is enforced, regardless of the order
in which 'PredictorVars' is provided. When not
provided, the predictors used to create the
creditscorecard object (by using creditscorecard) are
used.

The variable selection method to fit the logistic regression
model, specified as the comma-separated pair consisting of
'VariableSelection' and a character vector with
values 'Stepwise' or 'FullModel':

Stepwise — Uses a stepwise
selection method which calls the Statistics and Machine
Learning Toolbox™ function stepwiseglm.
Only variables in PredictorVars can
potentially become part of the model and uses the
StartingModel name-value pair
argument to select the starting model.

FullModel — Fits a model with
all predictor variables in the
PredictorVars name-value pair
argument and calls fitglm.

Note

Only variables in the PredictorVars
property of the creditscorecard object can
potentially become part of the logistic regression model and
only linear terms are included in this model with no
interactions or any other higher-order terms.

Initial model for the Stepwise variable
selection method, specified as the comma-separated pair consisting of
'StartingModel' and a character vector with
values 'Constant' or 'Linear'.
This option determines the initial model (constant or linear) that the
Statistics and Machine
Learning Toolbox function stepwiseglm starts with.

Output Arguments

sc — Credit scorecard modelcreditscorecard object

Credit scorecard model, returned as an updated
creditscorecard object. The
creditscorecard object contains information about
the model predictors and coefficients used to fit the WOE data. For more
information on using the creditscorecard object, see
creditscorecard.

mdl — Fitted logistic modelGeneralizedLinearModel object

Fitted logistic model, retuned as an object of type
GeneralizedLinearModel containing the fitted
model. For more information on a
GeneralizedLinearModel object, see GeneralizedLinearModel.

Note

When creating the creditscorecard object
with creditscorecard,
if the optional name-value pair argument
WeightsVar was used to specify
observation (sample) weights, then mdl uses
the weighted counts with stepwiseglm and
fitglm.

This website uses cookies to improve your user experience, personalize content and ads, and analyze website traffic. By continuing to use this website, you consent to our use of cookies. Please see our Privacy Policy to learn more about cookies and how to change your settings.