Naive bayes

Ashraf Uddin
Ashraf UddinStudent um South Asian University
PRESENTATION ON
NAÏVE BAYESIAN CLASSIFICATION
Presented By:




                                   http://ashrafsau.blogspot.in/
Ashraf Uddin
Sujit Singh
Chetanya Pratap Singh
South Asian University
(Master of Computer Application)
http://ashrafsau.blogspot.in/
OUTLINE

 Introduction   to Bayesian Classification
   Bayes Theorem
   Naïve Bayes Classifier




                                              http://ashrafsau.blogspot.in/
   Classification Example



 Text   Classification – an Application

 Comparison     with other classifiers
   Advantages and disadvantages
   Conclusions
CLASSIFICATION
 Classification:
     predicts categorical class labels




                                                             http://ashrafsau.blogspot.in/
     classifies data (constructs a model) based on the
      training set and the values (class labels) in a
      classifying attribute and uses it in classifying new
      data

 Typical   Applications
     credit approval
     target marketing
     medical diagnosis
     treatment effectiveness analysis
A TWO STEP PROCESS
   Model construction: describing a set of predetermined
    classes
     Each tuple/sample is assumed to belong to a predefined




                                                                             http://ashrafsau.blogspot.in/
      class, as determined by the class label attribute
     The set of tuples used for model construction: training set
     The model is represented as classification rules, decision
      trees, or mathematical formulae
   Model usage: for classifying future or unknown objects
       Estimate accuracy of the model
          The known label of test sample is compared with the
           classified result from the model
          Accuracy rate is the percentage of test set samples that
           are correctly classified by the model
          Test set is independent of training set, otherwise over-fitting
           will occur
INTRODUCTION TO BAYESIAN CLASSIFICATION

 What   is it ?




                                                            http://ashrafsau.blogspot.in/
    Statistical method for classification.
    Supervised Learning Method.
    Assumes an underlying probabilistic model, the Bayes
     theorem.
    Can solve problems involving both categorical and
     continuous valued attributes.
    Named after Thomas Bayes, who proposed the Bayes
     Theorem.
http://ashrafsau.blogspot.in/
THE BAYES THEOREM

   The Bayes Theorem:
      P(H|X)= P(X|H) P(H)/ P(X)




                                                                               http://ashrafsau.blogspot.in/
   P(H|X) : Probability that the customer will buy a computer given that
    we know his age, credit rating and income. (Posterior Probability of
    H)
   P(H) : Probability that the customer will buy a computer regardless
    of age, credit rating, income (Prior Probability of H)
   P(X|H) : Probability that the customer is 35 yrs old, have fair credit
    rating and earns $40,000, given that he has bought our computer
    (Posterior Probability of X)
   P(X) : Probability that a person from our set of customers is 35 yrs
    old, have fair credit rating and earns $40,000. (Prior Probability of X)
http://ashrafsau.blogspot.in/
BAYESIAN CLASSIFIER
http://ashrafsau.blogspot.in/
NAÏVE BAYESIAN CLASSIFIER...
http://ashrafsau.blogspot.in/
NAÏVE BAYESIAN CLASSIFIER...
“ZERO” PROBLEM
   What if there is a class, Ci, and X has an attribute
    value, xk, such that none of the samples in Ci has




                                                             http://ashrafsau.blogspot.in/
    that attribute value?

   In that case P(xk|Ci) = 0, which results in P(X|Ci) =
    0 even though P(xk|Ci) for all the other attributes in
    X may be large.
NUMERICAL UNDERFLOW
 When p(x|Y ) is often a very small number: the
  probability of observing any particular high-




                                                   http://ashrafsau.blogspot.in/
  dimensional vector is small.
 This can lead to numerical under flow.
http://ashrafsau.blogspot.in/
LOG SUM-EXP TRICK
BASIC ASSUMPTION
   The Naïve Bayes assumption is that all the features
    are conditionally independent given the class label.




                                                            http://ashrafsau.blogspot.in/
   Even though this is usually false (since features are
    usually dependent)
EXAMPLE: CLASS-LABELED TRAINING TUPLES
FROM THE CUSTOMER DATABASE




                                         http://ashrafsau.blogspot.in/
http://ashrafsau.blogspot.in/
EXAMPLE…
http://ashrafsau.blogspot.in/
EXAMPLE…
USES OF NAÏVE BAYES CLASSIFICATION

   Text Classification
   Spam Filtering




                                                                http://ashrafsau.blogspot.in/
   Hybrid Recommender System
       Recommender Systems apply machine learning and
        data mining techniques for filtering unseen
        information and can predict whether a user would like
        a given resource
   Online Application
       Simple Emotion Modeling
TEXT CLASSIFICATION – AN
APPLICATION OF NAIVE BAYES
CLASSIFIER




                             http://ashrafsau.blogspot.in/
WHY TEXT CLASSIFICATION?

 Learning which articles are of interest




                                            http://ashrafsau.blogspot.in/
 Classify web pages by topic

 Information extraction

 Internet filters
EXAMPLES OF TEXT CLASSIFICATION

   CLASSES=BINARY
       “spam” / “not spam”




                                                   http://ashrafsau.blogspot.in/
   CLASSES =TOPICS
       “finance” / “sports” / “politics”

   CLASSES =OPINION
       “like” / “hate” / “neutral”

   CLASSES =TOPICS
       “AI” / “Theory” / “Graphics”

   CLASSES =AUTHOR
       “Shakespeare” / “Marlowe” / “Ben Jonson”
EXAMPLES OF TEXT CLASSIFICATION
 Classify news stories as
  world, business, SciTech, Sports ,Health etc
 Classify email as spam / not spam




                                                     http://ashrafsau.blogspot.in/
 Classify business names by industry
 Classify email to tech stuff as Mac, windows etc
 Classify pdf files as research , other
 Classify movie reviews as
  favorable, unfavorable, neutral
 Classify documents
 Classify technical papers as
  Interesting, Uninteresting
 Classify Jokes as Funny, Not Funny
 Classify web sites of companies by Standard
  Industrial Classification (SIC)
NAÏVE BAYES APPROACH
   Build the Vocabulary as the list of all distinct words that
    appear in all the documents of the training set.




                                                                  http://ashrafsau.blogspot.in/
   Remove stop words and markings
   The words in the vocabulary become the
    attributes, assuming that classification is independent of
    the positions of the words
   Each document in the training set becomes a record
    with frequencies for each word in the Vocabulary.
   Train the classifier based on the training data set, by
    computing the prior probabilities for each class and
    attributes.
   Evaluate the results on Test data
REPRESENTING TEXT: A LIST OF WORDS




                                      http://ashrafsau.blogspot.in/
   Common Refinements: Remove Stop
    Words, Symbols
TEXT CLASSIFICATION ALGORITHM:
NAÏVE BAYES




                                                        http://ashrafsau.blogspot.in/
 Tct – Number of particular word in particular class
 Tct’ – Number of total words in particular class

 B’ – Number of distinct words in all class
http://ashrafsau.blogspot.in/
EXAMPLE
EXAMPLE CONT…




                                                      http://ashrafsau.blogspot.in/
 oProbability of Yes Class is more than that of No
 Class, Hence this document will go into Yes Class.
Advantages and Disadvantages of Naïve Bayes
Advantages :
   Easy to implement
   Requires a small amount of training data to estimate
   the parameters




                                                                       http://ashrafsau.blogspot.in/
   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 modelled by Naïve
   Bayesian Classifier
An extension of Naive Bayes for delivering robust
classifications

•Naive assumption (statistical independent. of the features
given the class)




                                                              http://ashrafsau.blogspot.in/
•NBC computes a single posterior distribution.
•However, the most probable class might depend on the
chosen prior, especially on small data sets.
•Prior-dependent classifications might be weak.
Solution via set of probabilities:
•Robust Bayes Classifier (Ramoni and Sebastiani, 2001)
•Naive Credal Classifier (Zaffalon, 2001)
•Violation of Independence Assumption




                                        http://ashrafsau.blogspot.in/
•Zero conditional probability Problem
VIOLATION       OF INDEPENDENCE                 ASSUMPTION


   Naive Bayesian classifiers assume that the effect of
    an attribute value on a given class is independent




                                                                       http://ashrafsau.blogspot.in/
    of   the   values     of    the     other    attributes.    This
    assumption      is         called      class       conditional
    independence.        It    is   made        to   simplify    the
    computations involved and, in this sense, is
    considered “naive.”
IMPROVEMENT

   Bayesian belief network are graphical
    models, which unlike naïve Bayesian




                                                    http://ashrafsau.blogspot.in/
    classifiers, allow the representation of
    dependencies among subsets of attributes.



   Bayesian belief networks can also be used for
    classification.
ZERO   CONDITIONAL PROBABILITY           PROBLEM
        If a given class and feature value never occur
    together in the training set then the frequency-




                                                              http://ashrafsau.blogspot.in/
    based probability estimate will be zero.

    This is problematic since it will wipe out all
    information in the other probabilities when they are
    multiplied.

   It is therefore often desirable to incorporate a small-
    sample correction in all probability estimates such
    that no probability is ever set to be exactly zero.
CORRECTION

   To eliminate zeros, we use add-one or Laplace
    smoothing, which simply adds




                                                    http://ashrafsau.blogspot.in/
    one to each count
EXAMPLE
   Suppose that for the class buys computer D (yes) in some training
    database, D, containing 1000 tuples.
       we have 0 tuples with income D low,
       990 tuples with income D medium, and
       10 tuples with income D high.




                                                                             http://ashrafsau.blogspot.in/
   The probabilities of these events, without the Laplacian correction, are
    0, 0.990 (from 990/1000), and 0.010 (from 10/1000), respectively.
   Using the Laplacian correction for the three quantities, we pretend that
    we have 1 more tuple for each income-value pair. In this way, we instead
    obtain the following probabilities :




    respectively. The “corrected” probability estimates are close to their
    “uncorrected” counterparts, yet the zero probability value is avoided.
Remarks on the Naive Bayesian Classifier
•Studies comparing classification algorithms have found that
the naive Bayesian classifier to be comparable in




                                                           http://ashrafsau.blogspot.in/
performance with decision tree and selected neural network
classifiers.


•Bayesian classifiers have also exhibited high accuracy and
speed when applied to large databases.
Conclusions
The naive Bayes model is tremendously appealing because of its
simplicity, elegance, and robustness.
 It is one of the oldest formal classification algorithms, and yet even in




                                                                          http://ashrafsau.blogspot.in/
its simplest form it is often surprisingly effective.
It is widely used in areas such as text classification and spam filtering.
A large number of modifications have been introduced, by the
statistical, data mining, machine learning, and pattern recognition
communities, in an attempt to make it more flexible.
 but some one has to recognize that such modifications are
necessarily complications, which detract from its basic simplicity.
REFERENCES

 http://en.wikipedia.org/wiki/Naive_Bayes_classifier
 http://www.cs.cmu.edu/afs/cs.cmu.edu/project/theo-




                                                        http://ashrafsau.blogspot.in/
  20/www/mlbook/ch6.pdf
 Data Mining: Concepts and Techniques, 3rd
  Edition, Han & Kamber & Pei ISBN: 9780123
  814791
1 von 38

Recomendados

Naive Bayes von
Naive BayesNaive Bayes
Naive BayesCloudxLab
7.6K views27 Folien
Naive Bayes Presentation von
Naive Bayes PresentationNaive Bayes Presentation
Naive Bayes PresentationMd. Enamul Haque Chowdhury
10.9K views32 Folien
Support Vector Machines ( SVM ) von
Support Vector Machines ( SVM ) Support Vector Machines ( SVM )
Support Vector Machines ( SVM ) Mohammad Junaid Khan
35.9K views26 Folien
NAIVE BAYES CLASSIFIER von
NAIVE BAYES CLASSIFIERNAIVE BAYES CLASSIFIER
NAIVE BAYES CLASSIFIERKnoldus Inc.
5.9K views36 Folien
Ensemble learning von
Ensemble learningEnsemble learning
Ensemble learningHaris Jamil
8.7K views14 Folien

Más contenido relacionado

Was ist angesagt?

2.3 bayesian classification von
2.3 bayesian classification2.3 bayesian classification
2.3 bayesian classificationKrish_ver2
22.5K views16 Folien
2.5 backpropagation von
2.5 backpropagation2.5 backpropagation
2.5 backpropagationKrish_ver2
24.7K views20 Folien
Machine learning clustering von
Machine learning clusteringMachine learning clustering
Machine learning clusteringCosmoAIMS Bassett
4.8K views15 Folien
Decision tree induction \ Decision Tree Algorithm with Example| Data science von
Decision tree induction \ Decision Tree Algorithm with Example| Data scienceDecision tree induction \ Decision Tree Algorithm with Example| Data science
Decision tree induction \ Decision Tree Algorithm with Example| Data scienceMaryamRehman6
1.4K views30 Folien
Association rule mining von
Association rule miningAssociation rule mining
Association rule miningAcad
42K views54 Folien
Classification and Regression von
Classification and RegressionClassification and Regression
Classification and RegressionMegha Sharma
1.9K views12 Folien

Was ist angesagt?(20)

2.3 bayesian classification von Krish_ver2
2.3 bayesian classification2.3 bayesian classification
2.3 bayesian classification
Krish_ver222.5K views
2.5 backpropagation von Krish_ver2
2.5 backpropagation2.5 backpropagation
2.5 backpropagation
Krish_ver224.7K views
Decision tree induction \ Decision Tree Algorithm with Example| Data science von MaryamRehman6
Decision tree induction \ Decision Tree Algorithm with Example| Data scienceDecision tree induction \ Decision Tree Algorithm with Example| Data science
Decision tree induction \ Decision Tree Algorithm with Example| Data science
MaryamRehman61.4K views
Association rule mining von Acad
Association rule miningAssociation rule mining
Association rule mining
Acad42K views
Classification and Regression von Megha Sharma
Classification and RegressionClassification and Regression
Classification and Regression
Megha Sharma1.9K views
K mean-clustering algorithm von parry prabhu
K mean-clustering algorithmK mean-clustering algorithm
K mean-clustering algorithm
parry prabhu50.6K views
Machine Learning-Linear regression von kishanthkumaar
Machine Learning-Linear regressionMachine Learning-Linear regression
Machine Learning-Linear regression
kishanthkumaar3.3K views
3.2 partitioning methods von Krish_ver2
3.2 partitioning methods3.2 partitioning methods
3.2 partitioning methods
Krish_ver245.1K views
Convolution Neural Network (CNN) von Suraj Aavula
Convolution Neural Network (CNN)Convolution Neural Network (CNN)
Convolution Neural Network (CNN)
Suraj Aavula14.1K views
Classification Based Machine Learning Algorithms von Md. Main Uddin Rony
Classification Based Machine Learning AlgorithmsClassification Based Machine Learning Algorithms
Classification Based Machine Learning Algorithms
Md. Main Uddin Rony9.9K views
Supervised learning and Unsupervised learning von Usama Fayyaz
Supervised learning and Unsupervised learning Supervised learning and Unsupervised learning
Supervised learning and Unsupervised learning
Usama Fayyaz5.1K views
Unsupervised learning von amalalhait
Unsupervised learningUnsupervised learning
Unsupervised learning
amalalhait14.4K views
Deep Learning Explained von Melanie Swan
Deep Learning ExplainedDeep Learning Explained
Deep Learning Explained
Melanie Swan41.4K views
Machine Learning: Generative and Discriminative Models von butest
Machine Learning: Generative and Discriminative ModelsMachine Learning: Generative and Discriminative Models
Machine Learning: Generative and Discriminative Models
butest5.3K views
Naive Bayes Classifier von Yiqun Hu
Naive Bayes ClassifierNaive Bayes Classifier
Naive Bayes Classifier
Yiqun Hu1.6K views

Destacado

Lecture10 - Naïve Bayes von
Lecture10 - Naïve BayesLecture10 - Naïve Bayes
Lecture10 - Naïve BayesAlbert Orriols-Puig
12.9K views18 Folien
Introduction to text classification using naive bayes von
Introduction to text classification using naive bayesIntroduction to text classification using naive bayes
Introduction to text classification using naive bayesDhwaj Raj
6.5K views25 Folien
Lecture 5: Bayesian Classification von
Lecture 5: Bayesian ClassificationLecture 5: Bayesian Classification
Lecture 5: Bayesian ClassificationMarina Santini
6.6K views17 Folien
Dwdm naive bayes_ankit_gadgil_027 von
Dwdm naive bayes_ankit_gadgil_027Dwdm naive bayes_ankit_gadgil_027
Dwdm naive bayes_ankit_gadgil_027ankitgadgil
1.8K views11 Folien
ML KNN-ALGORITHM von
ML KNN-ALGORITHMML KNN-ALGORITHM
ML KNN-ALGORITHMAteeq Ur Rehman
1K views5 Folien
Genetic Algorithm by Example von
Genetic Algorithm by ExampleGenetic Algorithm by Example
Genetic Algorithm by ExampleNobal Niraula
96.8K views38 Folien

Destacado(7)

Introduction to text classification using naive bayes von Dhwaj Raj
Introduction to text classification using naive bayesIntroduction to text classification using naive bayes
Introduction to text classification using naive bayes
Dhwaj Raj6.5K views
Lecture 5: Bayesian Classification von Marina Santini
Lecture 5: Bayesian ClassificationLecture 5: Bayesian Classification
Lecture 5: Bayesian Classification
Marina Santini6.6K views
Dwdm naive bayes_ankit_gadgil_027 von ankitgadgil
Dwdm naive bayes_ankit_gadgil_027Dwdm naive bayes_ankit_gadgil_027
Dwdm naive bayes_ankit_gadgil_027
ankitgadgil1.8K views
Genetic Algorithm by Example von Nobal Niraula
Genetic Algorithm by ExampleGenetic Algorithm by Example
Genetic Algorithm by Example
Nobal Niraula96.8K views
Data mining project presentation von Kaiwen Qi
Data mining project presentationData mining project presentation
Data mining project presentation
Kaiwen Qi8.2K views

Similar a Naive bayes

Supervised algorithms von
Supervised algorithmsSupervised algorithms
Supervised algorithmsYassine Akhiat
648 views49 Folien
Naive bayes von
Naive bayesNaive bayes
Naive bayesLearnbay Datascience
130 views10 Folien
Naive bayes classifier von
Naive bayes classifierNaive bayes classifier
Naive bayes classifierAbhijit Sengupta
662 views7 Folien
Catégorisation automatisée de contenus documentaires : la ... von
Catégorisation automatisée de contenus documentaires : la ...Catégorisation automatisée de contenus documentaires : la ...
Catégorisation automatisée de contenus documentaires : la ...butest
336 views43 Folien
Introduction von
IntroductionIntroduction
Introductionbutest
243 views36 Folien
Introduction von
IntroductionIntroduction
Introductionbutest
190 views36 Folien

Similar a Naive bayes(20)

Catégorisation automatisée de contenus documentaires : la ... von butest
Catégorisation automatisée de contenus documentaires : la ...Catégorisation automatisée de contenus documentaires : la ...
Catégorisation automatisée de contenus documentaires : la ...
butest336 views
Introduction von butest
IntroductionIntroduction
Introduction
butest243 views
Introduction von butest
IntroductionIntroduction
Introduction
butest190 views
Introduction von butest
IntroductionIntroduction
Introduction
butest284 views
Classification with Naive Bayes von Josh Patterson
Classification with Naive BayesClassification with Naive Bayes
Classification with Naive Bayes
Josh Patterson19K views
Machine Learning with WEKA von butest
Machine Learning with WEKAMachine Learning with WEKA
Machine Learning with WEKA
butest1.6K views
Developing Knowledge-Based Systems von Ashique Rasool
Developing Knowledge-Based SystemsDeveloping Knowledge-Based Systems
Developing Knowledge-Based Systems
Ashique Rasool7.7K views
lazy learners and other classication methods von rajshreemuthiah
lazy learners and other classication methodslazy learners and other classication methods
lazy learners and other classication methods
rajshreemuthiah7.5K views
Introduction to EBSCOhost Research databases at University of Galway Library von rosie.dunne
Introduction to EBSCOhost Research databases at University of Galway Library Introduction to EBSCOhost Research databases at University of Galway Library
Introduction to EBSCOhost Research databases at University of Galway Library
rosie.dunne214 views
Textmining Predictive Models von guest0edcaf
Textmining Predictive ModelsTextmining Predictive Models
Textmining Predictive Models
guest0edcaf1.3K views
Alexandr Lyalyuk - PHP Machine Learning and user-oriented content von DrupalCamp Kyiv
Alexandr Lyalyuk - PHP Machine Learning and user-oriented contentAlexandr Lyalyuk - PHP Machine Learning and user-oriented content
Alexandr Lyalyuk - PHP Machine Learning and user-oriented content
DrupalCamp Kyiv276 views

Más de Ashraf Uddin

A short tutorial on r von
A short tutorial on rA short tutorial on r
A short tutorial on rAshraf Uddin
1.9K views31 Folien
Big Data: Its Characteristics And Architecture Capabilities von
Big Data: Its Characteristics And Architecture CapabilitiesBig Data: Its Characteristics And Architecture Capabilities
Big Data: Its Characteristics And Architecture CapabilitiesAshraf Uddin
7.5K views29 Folien
MapReduce: Simplified Data Processing on Large Clusters von
MapReduce: Simplified Data Processing on Large ClustersMapReduce: Simplified Data Processing on Large Clusters
MapReduce: Simplified Data Processing on Large ClustersAshraf Uddin
3.5K views32 Folien
Text Mining Infrastructure in R von
Text Mining Infrastructure in RText Mining Infrastructure in R
Text Mining Infrastructure in RAshraf Uddin
16.8K views49 Folien
Software piracy von
Software piracySoftware piracy
Software piracyAshraf Uddin
17.7K views54 Folien
Freenet von
FreenetFreenet
FreenetAshraf Uddin
9.2K views52 Folien

Más de Ashraf Uddin(7)

A short tutorial on r von Ashraf Uddin
A short tutorial on rA short tutorial on r
A short tutorial on r
Ashraf Uddin1.9K views
Big Data: Its Characteristics And Architecture Capabilities von Ashraf Uddin
Big Data: Its Characteristics And Architecture CapabilitiesBig Data: Its Characteristics And Architecture Capabilities
Big Data: Its Characteristics And Architecture Capabilities
Ashraf Uddin7.5K views
MapReduce: Simplified Data Processing on Large Clusters von Ashraf Uddin
MapReduce: Simplified Data Processing on Large ClustersMapReduce: Simplified Data Processing on Large Clusters
MapReduce: Simplified Data Processing on Large Clusters
Ashraf Uddin3.5K views
Text Mining Infrastructure in R von Ashraf Uddin
Text Mining Infrastructure in RText Mining Infrastructure in R
Text Mining Infrastructure in R
Ashraf Uddin16.8K views
Dynamic source routing von Ashraf Uddin
Dynamic source routingDynamic source routing
Dynamic source routing
Ashraf Uddin24.5K views

Último

JRN 362 - Lecture Twenty-Two von
JRN 362 - Lecture Twenty-TwoJRN 362 - Lecture Twenty-Two
JRN 362 - Lecture Twenty-TwoRich Hanley
41 views157 Folien
What is Digital Transformation? von
What is Digital Transformation?What is Digital Transformation?
What is Digital Transformation?Mark Brown
56 views11 Folien
BUSINESS ETHICS MODULE 1 UNIT I_B.pdf von
BUSINESS ETHICS MODULE 1 UNIT I_B.pdfBUSINESS ETHICS MODULE 1 UNIT I_B.pdf
BUSINESS ETHICS MODULE 1 UNIT I_B.pdfDr Vijay Vishwakarma
63 views21 Folien
OOPs - JAVA Quick Reference.pdf von
OOPs - JAVA Quick Reference.pdfOOPs - JAVA Quick Reference.pdf
OOPs - JAVA Quick Reference.pdfArthyR3
80 views66 Folien
Introduction to Physiotherapy and Electrotherapy von
Introduction to Physiotherapy and ElectrotherapyIntroduction to Physiotherapy and Electrotherapy
Introduction to Physiotherapy and ElectrotherapySreeraj S R
82 views10 Folien
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37 von
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37MysoreMuleSoftMeetup
59 views17 Folien

Último(20)

JRN 362 - Lecture Twenty-Two von Rich Hanley
JRN 362 - Lecture Twenty-TwoJRN 362 - Lecture Twenty-Two
JRN 362 - Lecture Twenty-Two
Rich Hanley41 views
What is Digital Transformation? von Mark Brown
What is Digital Transformation?What is Digital Transformation?
What is Digital Transformation?
Mark Brown56 views
OOPs - JAVA Quick Reference.pdf von ArthyR3
OOPs - JAVA Quick Reference.pdfOOPs - JAVA Quick Reference.pdf
OOPs - JAVA Quick Reference.pdf
ArthyR380 views
Introduction to Physiotherapy and Electrotherapy von Sreeraj S R
Introduction to Physiotherapy and ElectrotherapyIntroduction to Physiotherapy and Electrotherapy
Introduction to Physiotherapy and Electrotherapy
Sreeraj S R82 views
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37 von MysoreMuleSoftMeetup
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
JRN 362 - Lecture Twenty-Three (Epilogue) von Rich Hanley
JRN 362 - Lecture Twenty-Three (Epilogue)JRN 362 - Lecture Twenty-Three (Epilogue)
JRN 362 - Lecture Twenty-Three (Epilogue)
Rich Hanley46 views
The Future of Micro-credentials: Is Small Really Beautiful? von Mark Brown
The Future of Micro-credentials:  Is Small Really Beautiful?The Future of Micro-credentials:  Is Small Really Beautiful?
The Future of Micro-credentials: Is Small Really Beautiful?
Mark Brown131 views
Interaction of microorganisms with vascular plants.pptx von MicrobiologyMicro
Interaction of microorganisms with vascular plants.pptxInteraction of microorganisms with vascular plants.pptx
Interaction of microorganisms with vascular plants.pptx
Peripheral artery diseases by Dr. Garvit.pptx von garvitnanecha
Peripheral artery diseases by Dr. Garvit.pptxPeripheral artery diseases by Dr. Garvit.pptx
Peripheral artery diseases by Dr. Garvit.pptx
garvitnanecha147 views
From social media to generative media (3).pptx von Mark Carrigan
From social media to generative media (3).pptxFrom social media to generative media (3).pptx
From social media to generative media (3).pptx
Mark Carrigan88 views
Introduction to AERO Supply Chain - #BEAERO Trainning program von Guennoun Wajih
Introduction to AERO Supply Chain  - #BEAERO Trainning programIntroduction to AERO Supply Chain  - #BEAERO Trainning program
Introduction to AERO Supply Chain - #BEAERO Trainning program
Guennoun Wajih142 views
NodeJS and ExpressJS.pdf von ArthyR3
NodeJS and ExpressJS.pdfNodeJS and ExpressJS.pdf
NodeJS and ExpressJS.pdf
ArthyR360 views

Naive bayes

  • 1. PRESENTATION ON NAÏVE BAYESIAN CLASSIFICATION Presented By: http://ashrafsau.blogspot.in/ Ashraf Uddin Sujit Singh Chetanya Pratap Singh South Asian University (Master of Computer Application) http://ashrafsau.blogspot.in/
  • 2. OUTLINE  Introduction to Bayesian Classification  Bayes Theorem  Naïve Bayes Classifier http://ashrafsau.blogspot.in/  Classification Example  Text Classification – an Application  Comparison with other classifiers  Advantages and disadvantages  Conclusions
  • 3. CLASSIFICATION  Classification:  predicts categorical class labels http://ashrafsau.blogspot.in/  classifies data (constructs a model) based on the training set and the values (class labels) in a classifying attribute and uses it in classifying new data  Typical Applications  credit approval  target marketing  medical diagnosis  treatment effectiveness analysis
  • 4. A TWO STEP PROCESS  Model construction: describing a set of predetermined classes  Each tuple/sample is assumed to belong to a predefined http://ashrafsau.blogspot.in/ class, as determined by the class label attribute  The set of tuples used for model construction: training set  The model is represented as classification rules, decision trees, or mathematical formulae  Model usage: for classifying future or unknown objects  Estimate accuracy of the model  The known label of test sample is compared with the classified result from the model  Accuracy rate is the percentage of test set samples that are correctly classified by the model  Test set is independent of training set, otherwise over-fitting will occur
  • 5. INTRODUCTION TO BAYESIAN CLASSIFICATION  What is it ? http://ashrafsau.blogspot.in/  Statistical method for classification.  Supervised Learning Method.  Assumes an underlying probabilistic model, the Bayes theorem.  Can solve problems involving both categorical and continuous valued attributes.  Named after Thomas Bayes, who proposed the Bayes Theorem.
  • 7. THE BAYES THEOREM  The Bayes Theorem:  P(H|X)= P(X|H) P(H)/ P(X) http://ashrafsau.blogspot.in/  P(H|X) : Probability that the customer will buy a computer given that we know his age, credit rating and income. (Posterior Probability of H)  P(H) : Probability that the customer will buy a computer regardless of age, credit rating, income (Prior Probability of H)  P(X|H) : Probability that the customer is 35 yrs old, have fair credit rating and earns $40,000, given that he has bought our computer (Posterior Probability of X)  P(X) : Probability that a person from our set of customers is 35 yrs old, have fair credit rating and earns $40,000. (Prior Probability of X)
  • 11. “ZERO” PROBLEM  What if there is a class, Ci, and X has an attribute value, xk, such that none of the samples in Ci has http://ashrafsau.blogspot.in/ that attribute value?  In that case P(xk|Ci) = 0, which results in P(X|Ci) = 0 even though P(xk|Ci) for all the other attributes in X may be large.
  • 12. NUMERICAL UNDERFLOW  When p(x|Y ) is often a very small number: the probability of observing any particular high- http://ashrafsau.blogspot.in/ dimensional vector is small.  This can lead to numerical under flow.
  • 14. BASIC ASSUMPTION  The Naïve Bayes assumption is that all the features are conditionally independent given the class label. http://ashrafsau.blogspot.in/  Even though this is usually false (since features are usually dependent)
  • 15. EXAMPLE: CLASS-LABELED TRAINING TUPLES FROM THE CUSTOMER DATABASE http://ashrafsau.blogspot.in/
  • 18. USES OF NAÏVE BAYES CLASSIFICATION  Text Classification  Spam Filtering http://ashrafsau.blogspot.in/  Hybrid Recommender System  Recommender Systems apply machine learning and data mining techniques for filtering unseen information and can predict whether a user would like a given resource  Online Application  Simple Emotion Modeling
  • 19. TEXT CLASSIFICATION – AN APPLICATION OF NAIVE BAYES CLASSIFIER http://ashrafsau.blogspot.in/
  • 20. WHY TEXT CLASSIFICATION?  Learning which articles are of interest http://ashrafsau.blogspot.in/  Classify web pages by topic  Information extraction  Internet filters
  • 21. EXAMPLES OF TEXT CLASSIFICATION  CLASSES=BINARY  “spam” / “not spam” http://ashrafsau.blogspot.in/  CLASSES =TOPICS  “finance” / “sports” / “politics”  CLASSES =OPINION  “like” / “hate” / “neutral”  CLASSES =TOPICS  “AI” / “Theory” / “Graphics”  CLASSES =AUTHOR  “Shakespeare” / “Marlowe” / “Ben Jonson”
  • 22. EXAMPLES OF TEXT CLASSIFICATION  Classify news stories as world, business, SciTech, Sports ,Health etc  Classify email as spam / not spam http://ashrafsau.blogspot.in/  Classify business names by industry  Classify email to tech stuff as Mac, windows etc  Classify pdf files as research , other  Classify movie reviews as favorable, unfavorable, neutral  Classify documents  Classify technical papers as Interesting, Uninteresting  Classify Jokes as Funny, Not Funny  Classify web sites of companies by Standard Industrial Classification (SIC)
  • 23. NAÏVE BAYES APPROACH  Build the Vocabulary as the list of all distinct words that appear in all the documents of the training set. http://ashrafsau.blogspot.in/  Remove stop words and markings  The words in the vocabulary become the attributes, assuming that classification is independent of the positions of the words  Each document in the training set becomes a record with frequencies for each word in the Vocabulary.  Train the classifier based on the training data set, by computing the prior probabilities for each class and attributes.  Evaluate the results on Test data
  • 24. REPRESENTING TEXT: A LIST OF WORDS http://ashrafsau.blogspot.in/  Common Refinements: Remove Stop Words, Symbols
  • 25. TEXT CLASSIFICATION ALGORITHM: NAÏVE BAYES http://ashrafsau.blogspot.in/  Tct – Number of particular word in particular class  Tct’ – Number of total words in particular class  B’ – Number of distinct words in all class
  • 27. EXAMPLE CONT… http://ashrafsau.blogspot.in/ oProbability of Yes Class is more than that of No Class, Hence this document will go into Yes Class.
  • 28. Advantages and Disadvantages of Naïve Bayes Advantages : Easy to implement Requires a small amount of training data to estimate the parameters http://ashrafsau.blogspot.in/ 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 modelled by Naïve Bayesian Classifier
  • 29. An extension of Naive Bayes for delivering robust classifications •Naive assumption (statistical independent. of the features given the class) http://ashrafsau.blogspot.in/ •NBC computes a single posterior distribution. •However, the most probable class might depend on the chosen prior, especially on small data sets. •Prior-dependent classifications might be weak. Solution via set of probabilities: •Robust Bayes Classifier (Ramoni and Sebastiani, 2001) •Naive Credal Classifier (Zaffalon, 2001)
  • 30. •Violation of Independence Assumption http://ashrafsau.blogspot.in/ •Zero conditional probability Problem
  • 31. VIOLATION OF INDEPENDENCE ASSUMPTION  Naive Bayesian classifiers assume that the effect of an attribute value on a given class is independent http://ashrafsau.blogspot.in/ of the values of the other attributes. This assumption is called class conditional independence. It is made to simplify the computations involved and, in this sense, is considered “naive.”
  • 32. IMPROVEMENT  Bayesian belief network are graphical models, which unlike naïve Bayesian http://ashrafsau.blogspot.in/ classifiers, allow the representation of dependencies among subsets of attributes.  Bayesian belief networks can also be used for classification.
  • 33. ZERO CONDITIONAL PROBABILITY PROBLEM  If a given class and feature value never occur together in the training set then the frequency- http://ashrafsau.blogspot.in/ based probability estimate will be zero.  This is problematic since it will wipe out all information in the other probabilities when they are multiplied.  It is therefore often desirable to incorporate a small- sample correction in all probability estimates such that no probability is ever set to be exactly zero.
  • 34. CORRECTION  To eliminate zeros, we use add-one or Laplace smoothing, which simply adds http://ashrafsau.blogspot.in/ one to each count
  • 35. EXAMPLE  Suppose that for the class buys computer D (yes) in some training database, D, containing 1000 tuples.  we have 0 tuples with income D low,  990 tuples with income D medium, and  10 tuples with income D high. http://ashrafsau.blogspot.in/  The probabilities of these events, without the Laplacian correction, are 0, 0.990 (from 990/1000), and 0.010 (from 10/1000), respectively.  Using the Laplacian correction for the three quantities, we pretend that we have 1 more tuple for each income-value pair. In this way, we instead obtain the following probabilities : respectively. The “corrected” probability estimates are close to their “uncorrected” counterparts, yet the zero probability value is avoided.
  • 36. Remarks on the Naive Bayesian Classifier •Studies comparing classification algorithms have found that the naive Bayesian classifier to be comparable in http://ashrafsau.blogspot.in/ performance with decision tree and selected neural network classifiers. •Bayesian classifiers have also exhibited high accuracy and speed when applied to large databases.
  • 37. Conclusions The naive Bayes model is tremendously appealing because of its simplicity, elegance, and robustness.  It is one of the oldest formal classification algorithms, and yet even in http://ashrafsau.blogspot.in/ its simplest form it is often surprisingly effective. It is widely used in areas such as text classification and spam filtering. A large number of modifications have been introduced, by the statistical, data mining, machine learning, and pattern recognition communities, in an attempt to make it more flexible.  but some one has to recognize that such modifications are necessarily complications, which detract from its basic simplicity.
  • 38. REFERENCES  http://en.wikipedia.org/wiki/Naive_Bayes_classifier  http://www.cs.cmu.edu/afs/cs.cmu.edu/project/theo- http://ashrafsau.blogspot.in/ 20/www/mlbook/ch6.pdf  Data Mining: Concepts and Techniques, 3rd Edition, Han & Kamber & Pei ISBN: 9780123 814791