Description
Lab 4
Implement Linear Discriminant Analysis (LDA) and Quadratic Discriminant Analysis (QDA).
You should NOT use any machine learning library for this lab. Please only use NumPy in Python
to implement the algorithms. Perform classifications on the same Iris dataset as Lab 3.
Exercises:
1. Break the sample into 80% for training, and 20% for test datasets. You can choose the
first 80% instances from each class for training and the rest for testing.
2. Build an LDA classifier based on the training data. Report the training and test errors for
your classifier.
3. Build a QDA classifier based on the training data. Report the training and test errors for
your classifier.
4. Is there any class linearly separable from other classes? Explain your answer based on
your experiments.
5. Assume the features are independent, i.e., ∑ is a diagonal matrix. Repeat Question 3, and
report your results. Also, please report the training time of this method and the original
QDA that you implemented in Question 3.