example depending on our data setwe can choose any of the naive bayes model explained above herewe are implementing gaussian naive bayes model in pythonwe will start with required imports as followsimport numpy as np import matplotlib pyplot as plt import seaborn as snssns set(nowby using make_blobs(function of scikit learnwe can generate blobs of points with gaussian distribution as followsfrom sklearn datasets import make_blobs xy make_blobs( centers= random_state= cluster_std= plt scatter( [: ] [: ] =ys= cmap='summer')nextfor using gaussiannb modelwe need to import and make its object as followsfrom sklearn naive_bayes import gaussiannb model_gbn gaussiannb(model_gnb fit(xy)nowwe have to do prediction it can be done after generating some new data as followsrng np random randomstate( xnew [- - [ rng rand( ynew model_gnb predict(xnewnextwe are plotting new data to find its boundariesplt scatter( [: ] [: ] =ys= cmap='summer'lim plt axis(plt scatter(xnew[: ]xnew[: ] =ynews= cmap='summer'alpha= plt axis(lim)nowwith the help of following line of codeswe can find the posterior probabilities of first and second labelyprob model_gnb predict_proba(xnewyprob[- :round(