Main Content

Discriminant Analysis

Regularized linear and quadratic discriminant analysis

To interactively train a discriminant analysis model, use the Classification Learner app. For greater flexibility, train a discriminant analysis model using fitcdiscr in the command-line interface. After training, predict labels or estimate posterior probabilities by passing the model and predictor data to predict.


Classification LearnerTrain models to classify data using supervised machine learning


ClassificationDiscriminant PredictClassify observations using discriminant analysis model (Since R2024a)


expand all

fitcdiscrFit discriminant analysis classifier
makecdiscrConstruct discriminant analysis classifier from parameters
compactReduce size of discriminant analysis classifier
cvshrinkCross-validate regularization of linear discriminant
limeLocal interpretable model-agnostic explanations (LIME) (Since R2020b)
partialDependenceCompute partial dependence (Since R2020b)
permutationImportancePredictor importance by permutation (Since R2024a)
plotPartialDependenceCreate partial dependence plot (PDP) and individual conditional expectation (ICE) plots
shapleyShapley values (Since R2021a)
crossvalCross-validate machine learning model
kfoldEdgeClassification edge for cross-validated classification model
kfoldLossClassification loss for cross-validated classification model
kfoldfunCross-validate function for classification
kfoldMarginClassification margins for cross-validated classification model
kfoldPredictClassify observations in cross-validated classification model
lossClassification loss for discriminant analysis classifier
resubLossResubstitution classification loss for discriminant analysis classifier
logpLog unconditional probability density for discriminant analysis classifier
mahalMahalanobis distance to class means of discriminant analysis classifier
nLinearCoeffsNumber of nonzero linear coefficients in discriminant analysis classifier
compareHoldoutCompare accuracies of two classification models using new data
edgeClassification edge for discriminant analysis classifier
marginClassification margins for discriminant analysis classifier
resubEdgeResubstitution classification edge for discriminant analysis classifier
resubMarginResubstitution classification margins for discriminant analysis classifier
testckfoldCompare accuracies of two classification models by repeated cross-validation
predictPredict labels using discriminant analysis classifier
resubPredictClassify observations in discriminant analysis classifier by resubstitution
classifyClassify observations using discriminant analysis


ClassificationDiscriminantDiscriminant analysis classification
CompactClassificationDiscriminantCompact discriminant analysis classification
ClassificationPartitionedModelCross-validated classification model