ML Lec-11
ML Lec-11
ML Lec-11
LECTURE-11
BY
Dr. Ramesh Kumar Thakur
Assistant Professor (II)
School Of Computer Engineering
v F1-Score: - It is the harmonic mean of precision and recall values for a classification problem. The
formula for F1-Score is as follows:
When AUC = 1, the classifier can When 0.5<AUC<1, there is a high When AUC=0.5, then the
correctly distinguish between all the chance that the classifier will be classifier is not able to
Positive and the Negative class able to distinguish the positive distinguish between Positive and
points. class values from the negative ones. Negative class points.
v Q. Consider a confusion matrix made for a classifier that classifies people based on whether they speak
English or Spanish.
v Where,
v P(A|B) is Posterior probability: Probability of hypothesis A on the observed event B.
v P(B|A) is Likelihood probability: Probability of the evidence given that the probability of a hypothesis is
true.
v P(A) is Prior Probability: Probability of hypothesis before observing the evidence.
v P(B) is Marginal Probability: Probability of Evidence.
v Working of Naïve Bayes' Classifier can be understood with the help of the below example:
v Suppose we have a dataset of weather conditions and corresponding target variable "Play". So using this
dataset we need to decide that whether we should play or not on a particular day according to the weather
conditions. So to solve this problem, we need to follow the below steps:
v Since P(Yes|Sunny)>P(No|Sunny), Hence on a Sunny day, Player can play the game.
v Advantages:-
v Naïve Bayes is one of the fast and easy ML algorithms to predict a class of datasets.
v It can be used for Binary as well as Multi-class Classifications.
v It performs well in Multi-class predictions as compared to the other Algorithms.
v It is the most popular choice for text classification problems.
v Disadvantages:-
v Naive Bayes assumes that all features are independent or unrelated, so it cannot learn the relationship
between features.
v Applications:-
v It is used for Credit Scoring.
v It is used in medical data classification.
v It can be used in real-time predictions because Naïve Bayes Classifier is an eager learner.
v It is used in Text classification such as Spam filtering and Sentiment analysis.
v There are three types of Naive Bayes Model, which are given below:
v Gaussian: The Gaussian model assumes that features follow a normal distribution. This means if
predictors take continuous values instead of discrete, then the model assumes that these values are
sampled from the Gaussian distribution.
v Multinomial: The Multinomial Naïve Bayes classifier is used when the data is multinomial distributed.
It is primarily used for document classification problems, it means a particular document belongs to
which category such as Sports, Politics, education, etc. The classifier uses the frequency of words for
the predictors.
v Bernoulli: The Bernoulli classifier works similar to the Multinomial classifier, but the predictor
variables are the independent Booleans variables. Such as if a particular word is present or not in a
document. This model is also famous for document classification tasks.