The goal of all classification algorithms is to predict the probability of a class y given a data point x. For example, consider a prediction problem where we are trying to predict if it will rain on a given day given the temperature on that day. If the probability of…