Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

B Naive Bayesian classifier The Naive Bayesian Classifier algorithm is a classification algorithm based on calculating the probability of belonging to each class. That is

B Naive Bayesian classifier
The Naive Bayesian Classifier algorithm is a classification algorithm based on calculating the probability of belonging to each class. That is to say that the test data (to be classified) will be assigned to the most likely class. The probability of belonging to each class is calculated from the learning data as follows:
class(x)=argmaxk{iP(wik)P(k)}
Here P(k) is the a priori probability of belonging to the class k. in other words its the probability of obtaining a data of class k if we draw a data at random. P(xik) is the probability that a data x has the value xi for the variable i, if we know its class k. Here we will calculate this probability by calculating the distance between the data xi and each barycenter of the classes (i.e. the class average), divided by the sum distances between this data and each barycenter.
List of useful functions:
mean, sum: calculate the mean and the sum of a list of values.
unique: returns the list of list values, without repeating values.
asarray: transforms a list into a vector.
vector.prod: makes the product of the values of a vector.
naive_bayes.GaussianNB: the naive Bayesian Classifier from sklearn.
Create a CBN(x,Y) function that takes x data and labels as input Y and which returns a label, for each data, predicted from class la more likely according to equation (1). Here again, we take each data, one by one, as test data and we consider all data as training data. It is advisable to first calculate the barycentres and the a priori probabilities P(k) for each class, then calculate the conditional probabilities P(xik) for each class and each variable.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions

Question

What has been your desire for leadership in CVS Health?

Answered: 1 week ago

Question

Question 5) Let n = N and Y Answered: 1 week ago

Answered: 1 week ago