Naive Bayes Classifier - Example -classify- play tennis - forecast


NaΓ―ve Bayes Classifier - Example -classify- play tennis - forecast

  • Let’s build a classifier that predicts whether I should play tennis given the forecast
  • It takes four attributes to describe the forecast; namely, 
    1. the outlook
    2. the temperature
    3. the humidity, and 
    4. the presence or absence of wind
  • Furthermore, the values of the four attributes are qualitative (also known as categorical). 
  • They take on the values shown below.
    • π‘Άπ’–π’•π’π’π’π’Œ ∈[π‘Ίπ’–π’π’π’š,𝑢𝒗𝒆𝒓𝒄𝒂𝒔𝒕, π‘Ήπ’‚π’Šπ’π’š]
    • π‘»π’†π’Žπ’‘π’†π’“π’‚π’•π’–π’“π’†∈[𝑯𝒐𝒕,π‘΄π’Šπ’π’…, π‘ͺ𝒐𝒐𝒍]
    • π‘―π’–π’Žπ’Šπ’…π’Šπ’•π’š ∈[π‘―π’Šπ’ˆπ’‰, π‘΅π’π’“π’Žπ’‚π’]
    • π‘Ύπ’Šπ’π’…π’š ∈[π‘Ύπ’†π’‚π’Œ, π‘Ίπ’•π’“π’π’π’ˆ]
  • The class label is the variable, Play and takes the values Yes or No.
    • π‘·π’π’‚π’š∈[𝒀𝒆𝒔, 𝑡𝒐]
  • We read-in training data below that has been collected over 14 days














Classification Phase

Let’s say, we get a new instance of the weather condition
 π‘Ώ^′=(π‘Άπ’–π’•π’π’π’π’Œ=π‘Ίπ’–π’π’π’š, π‘»π’†π’Žπ’‘π’†π’“π’‚π’•π’–π’“π’†=π‘ͺ𝒐𝒐𝒍, π‘―π’–π’Žπ’Šπ’…π’Šπ’•π’š=π‘―π’Šπ’ˆπ’‰, π‘Ύπ’Šπ’π’…=π‘Ίπ’•π’“π’π’π’ˆ)  
 that will have to be classified (i.e., are we going to play tennis under the conditions specified by 𝑋^′).
With the MAP rule, we compute the posterior probabilities.
 This is easily done by looking up the tables we built in the learning phase.






Comments