the above series of and are the predicted values for the tumor classes malignant and benign nowby comparing the two arrays namely test_labels and predswe can find out the accuracy of our model we are going to use the accuracy_score(function to determine the accuracy consider the following command for thisfrom sklearn metrics import accuracy_score print(accuracy_score(test_labels,preds) the result shows that the naivebayes classifier is accurate in this waywith the help of the above steps we can build our classifier in python building classifier in python in this sectionwe will learn how to build classifier in python naive bayes classifier naive bayes is classification technique used to build classifier using the bayes theorem the assumption is that the predictors are independent in simple wordsit assumes that the presence of particular feature in class is unrelated to the presence of any other feature for building naive bayes classifier we need to use the python library called scikit learn there are three types of naive bayes models named gaussianmultinomial and bernoulli under scikit learn package to build naive bayes machine learning classifier modelwe need the followingdataset we are going to use the dataset named breast cancer wisconsin diagnostic database the dataset includes various information about breast cancer tumorsas well as classification labels of malignant or benign the dataset has instancesor dataon tumors and includes information on attributesor featuressuch as the radius of the tumortexturesmoothnessand area we can import this dataset from sklearn package naive bayes model for building naive bayes classifierwe need naive bayes model as told earlierthere are three types of naive bayes models named gaussianmultinomial and bernoulli under scikit learn package herein the following example we are going to use the gaussian naive bayes model