#impot Labiraries
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import MultinomialNB
from sklearn.metrics import confusion_matrix
import seaborn as sns
import matplotlib.pyplot as plt

#Load Breast Cancer Data 
BreastCancer = load_breast_cancer()
#X Data
X = BreastCancer.data
# Y Data
Y = BreastCancer.target
#Splitting Data
x_train , x_test , y_train , y_test = train_test_split(X,Y,test_size=0.32,random_state=23)

'''
Sklearn.naive_bayes.MultinomialNB(alpha)
'''
MultinomialNBModel = MultinomialNB(alpha=1.0)
MultinomialNBModel.fit(x_train , y_train)

#Calculating Score for training and Testing
print('MultinoialNBModel Train score is : ' , MultinomialNBModel.score(x_train,y_train))
print('MultinomialNBModel Test score is : ' , MultinomialNBModel.score(x_test,y_test))

y_pred=MultinomialNBModel.predict(x_test)
y_pred_proba=MultinomialNBModel.predict(x_test)
#printting prediction
print('predicted value for MultinomialNBModel is : \n',y_pred[:5])
print('prediction probabilaties value for MultinomialNBModel is :\n ' ,y_pred_proba[:7])
#Calculate Confusion Matrix 
#y_test is the real result
#y_pred is prediction for model

CM = confusion_matrix(y_test , y_pred)
print('confuion Matrix is : \n', CM)

"""
**14 and 2 unmatching
55 and 112 matching**
"""
#Drawing Confuion Matrix
sns.heatmap(CM,center=True)
plt.show(block=None)