### how to build gaussian naive bayes classifier from scratch

prob.append([self.gnb_base(x_value, class_one_x_mean, class_one_x_var)]) # turn prob into an array prob_array = np.array(prob) # split the probability into various classes again prob_split = np.vsplit(prob_array, self.n_class) # calculate the final probabilities final_probabilities = [] for i in prob_split: class_prob = np.prod(i) * self.prior final_probabilities.append(class_prob) # determining the maximum probability …