Exploring Discriminant Analysis

Naethreepremnath
Python’s Gurus
Published in
4 min readJun 26, 2024

Discriminant analysis (DA) is a statistical technique used to find a linear or quadratic combination of variables that best separates two or more classes or groups. Its primary objective is to determine which variables discriminate between the groups under study. Discriminant analysis is commonly used for classification and dimensionality reduction, aiming to predict group membership of observations based on their features.

Linear Discriminant Analysis(LDA):

When classes are well separated and when parameter estimation of logistic regression is unstable, LDA can be used. However, note that below two assumptions must be satisfied:

  1. The predictor variables within each group follow a multivariate normal distribution.
  2. The covariance matrices of the predictor variables are equal across all groups.

In LDA, the approach to classification does not directly involve calculating posterior probabilities. Instead, the method estimates parameters based on the assumption of normality and equal covariance, and then uses discriminant scores to assign observations to the most likely class.

The discriminant function is given as:

Note that if the first term in (1) is simplified, it can be observed that is in the linear form, hence the name Linear Discriminant Analysis.

Now, using the discriminant function in (1), discriminant scores are calculated and then an observation is assigned to the class with the highest discriminant score.

In some cases, the Bayes’ classifier may yield a low overall error but higher errors for specific classes. To address this, especially with imbalanced classes or different misclassification costs, a threshold can be introduced to adjust classification boundaries. For binary classification, can be set based on domain knowledge or ROC curves. The classifier’s performance is evaluated using the Area Under the Curve (AUC), with values close to 1 being preferred. Although the threshold from ROC curves may not minimize the overall misclassification error rate, it helps reduce the error rate for specific classes.

Now, one might wonder how to determine when to apply LDA, especially if the dataset’s dimensionality is high. It may seem challenging to visualize if the observations can be separated into two classes. Fisher’s Discriminant Analysis (FDA) provides a solution to this problem.

Fisher’s Discriminant Analysis (FDA):

FDA works by projecting the observations into a lower-dimensional space to visualize the separation between classes. The observations are mapped to this space, and the separation is examined using discriminant scores:

DC1: discriminant score relevant to the first direction

DC2: discriminant score relevant to the second direction.

If the two classes are well-separated along these discriminant scores, it indicates that LDA can be effectively applied to the dataset. This projection helps in assessing the potential of LDA for classification by simplifying the high-dimensional data into more interpretable dimensions.

Quadratic Discriminant Analysis (QDA):

QDA extends FDA by relaxing the assumption of equal covariance matrices across classes. Unlike FDA, which assumes that all classes share the same covariance structure, QDA allows each class to have its own covariance matrix.

Hence the only assumption is:

  1. The predictor variables within each group follow a multivariate normal distribution.

This flexibility makes QDA suitable for situations where the decision boundary between classes cannot be adequately modeled by a linear function but can be better approximated by a quadratic function or another non-linear form. The discriminant function in QDA is quadratic in nature, enabling it to capture more complex relationships between variables and to accommodate non-linear decision boundaries. However, this flexibility comes at the cost of increased model complexity and the need for more data to accurately estimate multiple covariance matrices.

Also it is noteworthy that since QDA retains the assumption of multivariate normality within each class, it is a robust method in capturing the variability and relationships present in different classes. This method is particularly useful when there is evidence of varying variances or covariance structures among classes, allowing for more accurate classification in such scenarios.

In conclusion, discriminant analysis (DA) encompasses both Linear Discriminant Analysis (LDA) and Quadratic Discriminant Analysis (QDA), each serving distinct purposes in classification tasks. LDA is ideal when classes are well-separated and the assumptions of multivariate normality and equal covariance matrices across groups are met. It provides a straightforward linear discriminant function that simplifies classification tasks based on discriminant scores. On the other hand, QDA relaxes the assumption of equal covariance matrices, allowing for more flexibility in modeling non-linear decision boundaries with quadratic discriminant functions. This makes QDA suitable for situations where class-specific covariance structures differ significantly, enhancing its accuracy in capturing complex relationships within data.

Understanding these methods’ strengths and assumptions is crucial for selecting the appropriate discriminant analysis technique based on the specific characteristics and goals of the dataset and classification problem at hand.

Python’s Gurus🚀

Thank you for being a part of the Python’s Gurus community!

Before you go:

  • Be sure to clap x50 time and follow the writer ️👏️️
  • Follow us: Newsletter
  • Do you aspire to become a Guru too? Submit your best article or draft to reach our audience.

--

--

Naethreepremnath
Python’s Gurus

BSc(Hons) in Data Science, University of Colombo (Reading) | Public Speaker | Writer