ML Assignment-7
ML Assignment-7
Title: Write a Program to Implement the Naïve Bayesian Classifier for a Sample Training Data
Set Stored as a .CSV File. Compute the Accuracy of the Classifier, Considering Few Test Data
Sets.
Software Requirement:
• Python
• NumPy
• scikit-learn
• Jupyter Notebook
Source Code:
import pandas as pd
from sklearn.model_selection import train_test_split from
sklearn.naive_bayes import GaussianNB
from sklearn.metrics import accuracy_score
Output:
Conclusions:
The Naïve Bayes classifier has been implemented successfully using the provided sample
dataset. The classifier was trained on the training data and evaluated on test data to compute its
accuracy. The high accuracy indicates that the classifier performs well in predicting class labels
for the given test samples. This implementation demonstrates the effectiveness of Naïve Bayes in
handling classification tasks with probabilistic modeling.