ClassificationDiscriminant.template

Class: ClassificationDiscriminant

Discriminant analysis classifier template for ensemble (to be removed)

ClassificationDiscriminant.template will be removed in a future release. Use templateDiscriminant instead.

Syntax

t = ClassificationDiscriminant.template()
t = ClassificationDiscriminant.template(Name,Value)

Description

t = ClassificationDiscriminant.template() returns a learner template suitable to use in the fitensemble function.

t = ClassificationDiscriminant.template(Name,Value) creates a template with additional options specified by one or more Name,Value pair arguments.

Input Arguments

expand all

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 single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

'Delta' — Linear coefficient threshold0 (default) | nonnegative scalar value

Linear coefficient threshold, specified as the comma-separated pair consisting of 'Delta' and a nonnegative scalar value. If a coefficient of obj has magnitude smaller than Delta, obj sets this coefficient to 0, and you can eliminate the corresponding predictor from the model. Set Delta to a higher value to eliminate more predictors.

Delta must be 0 for quadratic discriminant models.

Data Types: single | double

'DiscrimType' — Discriminant type'linear' (default) | 'quadratic' | 'diagLinear' | 'diagQuadratic' | 'pseudoLinear' | 'pseudoQuadratic'

Discriminant type, specified as the comma-separated pair consisting of 'DiscrimType' and one of the following:

  • 'linear'

  • 'quadratic'

  • 'diagLinear'

  • 'diagQuadratic'

  • 'pseudoLinear'

  • 'pseudoQuadratic'

Example: 'DiscrimType','quadratic'

'FillCoeffs'Coeffs property flag'on' | 'off'

Coeffs property flag, specified as the comma-separated pair consisting of 'FillCoeffs' and 'on' or 'off'. Setting the flag to 'on' populates the Coeffs property in the classifier object. This can be computationally intensive, especially when cross validating. The default is 'on', unless you specify a cross validation name-value pair, in which case the flag is set to 'off' by default.

Example: 'FillCoeffs','off'

'Gamma' — Regularization parameterscalar value in the range [0,1]

Parameter for regularizing the correlation matrix of predictors, specified as the comma-separated pair consisting of 'Gamma' and a scalar value in the range [0,1].

  • Linear discriminant — Scalar value in the range [0,1].

    • If you pass a value strictly between 0 and 1, fitcdiscr sets the discriminant type to 'Linear'.

    • If you pass 0 for Gamma and 'Linear' for DiscrimType, and if the correlation matrix is singular, fitcdiscr sets Gamma to the minimal value required for inverting the covariance matrix.

    • If you set Gamma to 1, fitcdiscr sets the discriminant type to 'DiagLinear'.

  • Quadratic discriminant — Either 0 or 1.

    • If you pass 0 for Gamma and 'Quadratic' for DiscrimType, and if one of the classes has a singular covariance matrix, fitcdiscr errors.

    • If you set Gamma to 1, fitcdiscr sets the discriminant type to 'DiagQuadratic'.

    • If you set Gamma to a value between 0 and 1 for a quadratic discriminant, fitcdiscr errors.

Example: 'Gamma',1

Data Types: single | double

'SaveMemory' — Flag to save covariance matrix'off' (default) | 'on'

Flag to save covariance matrix, specified as the comma-separated pair consisting of 'SaveMemory' and either 'on' or 'off'. If you specify 'on', then fitcdiscr does not store the full covariance matrix, but instead stores enough information to compute the matrix. The predict method computes the full covariance matrix for prediction, and does not store the matrix. If you specify 'off', then fitcdiscr computes and stores the full covariance matrix in obj.

Specify SaveMemory as 'on' when the input matrix contains thousands of predictors.

Example: 'SaveMemory','on'

Output Arguments

expand all

t — Discriminant analysis classification templateclassification template object

Discriminant analysis classification template suitable to use in the fitensemble function, returned as a classification template object. In an ensemble, t specifies how to create the discriminant analysis classifier.

Examples

expand all

Discriminant Analysis Template for Nondefault Options

Create a nondefault discriminant analysis template for use in fitensemble.

Create a template for pseudolinear discriminant analysis.

t = ClassificationDiscriminant.template('discrimType','pseudoLinear')
t = 

Fit template for classification Discriminant.

    DiscrimType: 'pseudoLinear'
          Gamma: []
          Delta: []
     FillCoeffs: []
     SaveMemory: []
         Method: 'Discriminant'
           Type: 'classification'

You can use t for ensemble learning.

Was this topic helpful?