Naive Bayes
Tags: #◇Computer Science #◇CSINTSY #◇Naive Bayes #◇Problem Solving #◇M4
◇Overview
Naive Bayes is a statistical supervised learning model that leverages Bayes' Theorem for classification. The core assumption that makes the model "naive" is the assumption of conditional independence between all input features given the target class. Even though features are rarely completely independent in real life, this assumption greatly simplifies computation and often works surprisingly well.
Bayes' Theorem Framework:
Prior: The probability of a target class occurring, .
Likelihood: The probability of observing the features given a target class.
Evidence/Marginal: The total probability of observing the features, which is often ignored during classification since it's the same across all target classes.
Posterior: The final computed probability of a class given the features.
◇Important Formulas
Bayes' Theorem:
Where is the target class and is the observed features.
Naive Bayes Assumption (Feature Independence):
For features :
Continuous Features (Gaussian Naive Bayes):
For numerical features, the likelihood is computed using the probability density function of a normal distribution defined by the mean and standard deviation of the feature for that class.
◇Worked Examples
Categorical Classification:
Given training data for student grades and study hours predicting a pass/fail outcome.
- Compute Prior for passing:
- Compute Likelihood of features for a Pass:
- Calculate posterior score by multiplying Prior and Likelihood. Repeat for the Fail class. Predict the class with the highest score.
◇References & Navigation
- Previous Topic: ◇Decision Trees
- Next Topic: ◇K-Means Clustering
- Related Notes: ◇Naive Bayes, ◇Bayesian Inference
ACTIVE RECALL VERIFICATION
Select an answer to verify conceptual comprehension and reveal the technical rationale.
What makes the Naive Bayes algorithm "naive"?
In the Bayes' Theorem framework, what does the "Prior" probability represent?
Why is the "Evidence/Marginal" probability () often ignored during classification using Naive Bayes?
How does Gaussian Naive Bayes calculate the likelihood for continuous, numerical features?
When combining multiple feature likelihoods in Naive Bayes, which mathematical operation is primarily used based on the independence assumption?