The likelihood that a fresh set of inputs belongs to each class is estimated using linear discriminant analysis. The output class with the highest probability is chosen. Here's how Bayes' theorem estimates the chance that the data belongs to each class if the output class is (k) and the input is (x).