table feature parameters feature feature feature class naivebayes py import numpy as np np array ([ , , ]reshape ( , mu np array ([ ]reshape ( , sig np array ([ ]reshape ( , lambda np prod(sig[ ,:]np exp- np sum (( -mu[ ,:]** sig[ ,:]** )for in range ( , )print ('{: }format ( ( )) + - + - linear and quadratic discriminant analysis the bayesian viewpoint for classification of the previous section (not limited to naive bayesleads in natural way to the well-established technique of discriminant analysis we discuss the binary classification case firstwith classes and we consider class of approximating functions such thatconditional on the class { }the feature vector [ ]has (uy sy distribution (see ( )) - ( thyp ( -uy sy ( -uy ( pp |sy rpy { }( where th { } - = collects all model parametersincluding the probability vector (that isi ai and ai which helps define the prior densityg( thay { thenthe posterior density is ( thxay ( thy)discriminant analysis