2B Naive Bayes
2B Naive Bayes
• Bayes Theorem
• Concept Learning
• Bayes Optimal Classifier
• Naïve Bayes Classifier
• Bayesian Belief Network
• EM Algorithm
Concept Learning: A task of acquiring potential hypothesis(solution)
that best fits the given training examples.
Answer is Naïve Bayes Classifier assumes attributes independence. (Because of this assumption
only the word “naïve” is being added with this.)
Example
Naïve Bayes Classifier Example
Bayes Theorem:
This is how Bayes Theorem looks like. To solve real world problems, In dataset D we have multiple attributes, so we
rewrite it in different way.
Naïve Bayes Classifier Algorithm
Where VNB stands for the Naive Bayes classifier’s target value.
Naïve Bayesian Classifier
• Advantages
• Easy to implement
• Good results obtained in most of the cases
• Disadvantages
• Assumption: class conditional independence, therefore loss of accuracy
• Practically, dependencies exist among variables
• E.g., hospitals: patients: Profile: age, family history, etc.
Symptoms: fever, cough etc., Disease: lung cancer, diabetes, etc.
• Dependencies among these cannot be modeled by Naïve Bayesian Classifier
• How to deal with these dependencies?
• Bayesian Belief Networks
Bayesian Belief Networks
• A Bayesian network (or a belief network) is a probabilistic graphical model that represents a set of variables
and their probabilistic independencies.
• Bayesian belief network allows a subset of the variables conditionally independent
• The goal of the SVM algorithm is to create the best line or decision boundary that
can segregate n-dimensional space into classes so that we can easily put the new
data point in the correct category in the future. This best decision boundary is
called a hyperplane.
• SVM chooses the extreme points/vectors that help in creating the hyperplane.
These extreme cases are called as support vectors, and hence algorithm is termed
as Support Vector Machine. Consider the below diagram in which there are two
different categories that are classified using a decision boundary or hyperplane.
Hyperplane and Support Vectors in the SVM
algorithm:
• Hyperplanes are decision boundaries that help classify the data
points. Data points falling on either side of the hyperplane can be
attributed to different classes. It is a subspace whose dimension is
one less than that of its ambient space. If a space is 3-dimensional
then its hyperplanes are the 2-dimensional planes, while if the
space is 2-dimensional, its hyperplanes are the 1-dimensional lines.
There can be multiple lines/decision boundaries to segregate the
classes in n-dimensional space, but we need to find out the best
decision boundary that helps to classify the data points. This best
boundary is known as the hyperplane of SVM.
Hyperplane and Support Vectors in the SVM
algorithm:
The dimensions of the hyperplane depend on the features present in the
dataset, which means if there are 2 features (as shown in image), then
hyperplane will be a straight line. And if there are 3 features, then
hyperplane will be a 2-dimension plane and so on
We always create a hyperplane that has a maximum margin, which means
the maximum distance between the data points. So, key idea behind the
SVM is to maximize the margin.
Support Vectors:
The data points or vectors that are the closest to the hyperplane and which
affect the position of the hyperplane are termed as Support Vector. Since
these vectors support the hyperplane, hence called a Support vector.
Issues in SVM-
SVM algorithm is not suitable for large data sets.
SVM does not perform very well when the data set has more noise i.e. target
classes are overlapping.
In cases where the number of features for each data point exceeds
the number of training data samples, the SVM will underperform.
• SVM is deterministic (but we can use Platts model for probability score) while Logistic Regression
is probabilistic.
• Problems that can be solved using SVM are Image Classification, Recognizing handwriting, Cancer
Detection.