Professional Documents
Culture Documents
Ai 8
Ai 8
Ai 8
In the previous lab, we performed the dimensionality reduction using PCA also known as
Principal Component Analysis. In this lab we will Calculate Linear discriminant projection
for 2 classes.
Fisher's Linear Discriminant projec on is actually a technique used for dimensionality
reduc on) and feature extrac on in the context of pa ern classifica on. The Fisher Linear
Discriminant Projec on involves finding a linear combina on of features that maximizes the
separa on between different classes in a dataset.
The main goal is to find a projec on direc on (a linear combina on of features) which
maximizes the ra o of the between-class variance to the within-class variance.
Code:
The steps of the algorithm are also given in the code comments 😊 :
import numpy as np
import matplotlib.pyplot as plt
The first subplot on the top le shows the sca er plot of the original data points for
both Classes
Each point represents a data sample with its coordinates on the X and Y axes.
Fisher Linear Discriminant Projec on:
The second subplot on the top gives us the sca er plot of the data points a er being
projected onto the Fisher Linear Discriminant.
The projec on is along a one-dimensional axis (Principal Component 1), which is the
direc on that maximizes the separa on between the two classes.
Contribution:
• Munim Naeem performed Data Preparation and Calculation of Scatter Matrices.
• Aleena Sehar performed Fisher Linear Discriminant Calculation and
Eigenvectors/Eigenvalues.