The first step in LDA is to calculate the mean of each feature within each class.In this step, we calculate the scatter matrix which measures the spread of the data within and between the classes.Next, we compute the eigenvectors and eigenvalues from the scatter matrices to find the optimal projection.Finally, we transform the data into a lower-dimensional space and visualize it in a scatter plot.