MACHINE LEARNING – MODULE 4
Complete Teacher-Style Mind Map / Cheat Sheet
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
BAYESIAN LEARNING
Definition
Bayesian Learning uses probability to make predictions under uncertainty.
Main Idea:
Learn from prior knowledge
Update beliefs using new evidence
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
PROBABILITY-BASED LEARNING
Features
Uses probabilistic models
Handles uncertainty & randomness
Learns from data
Predicts future events
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
BAYES THEOREM
Purpose
Calculates posterior probability using prior knowledge and evidence.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Bayes Theorem Formula
P(H|E)=\frac{P(E|H)P(H)}{P(E)}
Terms:
P(H) → Prior Probability
P(E|H) → Likelihood Probability
P(E) → Marginal Probability
P(H|E) → Posterior Probability
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
TYPES OF PROBABILITIES
Prior Probability
Probability before observing evidence.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Likelihood Probability
Probability of evidence given hypothesis.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Posterior Probability
Updated probability after observing evidence.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
CLASSIFICATION USING BAYES MODEL
Goal
Find most probable hypothesis.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
MAP Hypothesis
Full Form:
Maximum A Posteriori Hypothesis
Rule:
Choose hypothesis with highest posterior probability.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
MAP Formula
h_{MAP}=\arg\max_h P(E|h)P(h)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
MAXIMUM LIKELIHOOD HYPOTHESIS
Definition
Chooses hypothesis with maximum likelihood.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
ML Formula
h_{ML}=\arg\max_h P(E|h)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
NAÏVE BAYES ALGORITHM
Definition
Probabilistic classifier assuming features are independent.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Features
Simple & fast
Works well with large datasets
Handles text classification
Uses conditional probability
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
APPLICATIONS OF NAÏVE BAYES
Spam detection
Recommendation systems
Face recognition
Text classification
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
STEPS IN NAÏVE BAYES
1. Compute prior probability
2. Compute likelihood probability
3. Apply Bayes theorem
4. Compute posterior probability
5. Choose maximum probability class
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
CONDITIONAL PROBABILITY
Formula
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
ZERO PROBABILITY ERROR
Problem
If any likelihood becomes zero:
Entire probability becomes zero
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Solution
Laplace Correction / Smoothing
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
LAPLACE CORRECTION
Purpose
Avoid zero probability issue.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Method
Add 1 to every frequency count.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
BRUTE FORCE BAYES ALGORITHM
Definition
Computes posterior probability for all hypotheses.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Problem
Computationally expensive
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
BAYES OPTIMAL CLASSIFIER
Definition
Chooses class with maximum combined posterior probability.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Formula
v_{MAP}=\arg\max_{v_j}\sum_i P(v_j|h_i)P(h_i|T)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
GIBBS ALGORITHM
Definition
Randomly selects one hypothesis according to posterior probability.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Advantage
Reduces prediction error
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
NAÏVE BAYES FOR CONTINUOUS ATTRIBUTES
Problem
Continuous attributes cannot directly use frequency tables.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Solution
Gaussian Distribution
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
GAUSSIAN NAÏVE BAYES
Assumption
Continuous features follow normal distribution.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Gaussian Probability Formula
P(x_i|C_j)=\frac{1}{\sigma_j\sqrt{2\pi}}e^{-\frac{(x_i-\mu_j)^2}{2\sigma_j^2}}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Terms
μ → Mean
σ → Standard deviation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
ARTIFICIAL NEURAL NETWORKS (ANN)
Definition
Computational model inspired by biological brain neurons.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Applications
Pattern recognition
Image processing
Speech recognition
Medical diagnosis
Forecasting
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
HUMAN NERVOUS SYSTEM
Components
Central Nervous System (CNS)
Peripheral Nervous System (PNS)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
BIOLOGICAL NEURON
Parts
Dendrites
Soma / Cell Body
Axon
Synapse
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Working
Input → Processing → Output
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
ARTIFICIAL NEURON
Definition
Mathematical model of biological neuron.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Components
Inputs
Weights
Summation Function
Activation Function
Output
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
MCCULLOCH & PITTS NEURON MODEL
Features
First mathematical neuron model
Uses threshold activation
Fixed weights & threshold
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Net Sum Formula
Net=\sum_{i=1}^{n}x_iw_i
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Step Activation Function
f(x)=\begin{cases}1,&f(x)\geq\theta\0,&f(x)<\theta\end{cases}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
ANN STRUCTURE
Layers
Input Layer
Hidden Layer
Output Layer
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Working
1. Inputs enter network
2. Weighted summation
3. Activation applied
4. Output generated
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
ACTIVATION FUNCTIONS
Purpose
Introduce non-linearity.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
TYPES OF ACTIVATION FUNCTIONS
Identity Function
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Binary Step Function
f(x)=\begin{cases}1,&x\geq0\0,&x<0\end{cases}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Bipolar Step Function
f(x)=\begin{cases}1,&x\geq0\-1,&x<0\end{cases}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Sigmoid Function
\sigma(x)=\frac{1}{1+e^{-x}}
Features
Output between 0 and 1
S-shaped curve
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Bipolar Sigmoid Function
\sigma(x)=\frac{2}{1+e^{-x}}-1
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Ramp Function
f(x)=\begin{cases}1,&x>1\x,&0\leq x\leq1\0,&x<0\end{cases}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Tanh Function
tanh(x)=\frac{2}{1+e^{-2x}}-1
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
ReLU Function
f(x)=max(0,x)
Advantage
Reduces vanishing gradient problem
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Softmax Function
Used for multiclass classification.
s(x_i)=\frac{e^{x_i}}{\sum_{j=1}^{n}e^{x_j}}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
PERCEPTRON MODEL
Definition
Single-layer neural network for binary classification.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Components
Inputs
Weights
Bias
Net Sum
Activation Function
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Perceptron Formula
Net=\sum_{i=1}^{n}x_iw_i+bias
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
PERCEPTRON LEARNING ALGORITHM
Steps
1. Initialize weights
2. Compute net sum
3. Apply activation
4. Calculate error
5. Update weights
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Weight Update Rule
\Delta w_i=\alpha(t-o)x_i
Terms
α → Learning rate
t → Target output
o → Observed output
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
XOR PROBLEM
Problem
Single perceptron cannot solve XOR.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Reason
XOR is not linearly separable
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
DELTA LEARNING RULE
Purpose
Minimize error during training.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Training Error Formula
E=\frac{1}{2}\sum_{i=1}^{n}(O_{desired}-O_{estimated})^2
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
TYPES OF ARTIFICIAL NEURAL NETWORKS
Feed Forward Neural Network
Features
Information flows one direction
Simple architecture
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Fully Connected Neural Network
Features
Every neuron connected to next layer neurons
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Multi-Layer Perceptron (MLP)
Features
Multiple hidden layers
Uses backpropagation
Handles complex problems
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Feedback Neural Network
Features
Feedback connections present
Dynamic learning
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
APPLICATIONS OF ANN
Face recognition
Self-driving cars
Stock prediction
Fraud detection
Medical diagnosis
Robotics
Forecasting
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
ADVANTAGES OF ANN
Solves complex non-linear problems
Learns patterns automatically
Parallel processing
Handles noisy/incomplete data
High prediction accuracy
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
LIMITATIONS OF ANN
High computational cost
Requires large datasets
Difficult to interpret
Complex model design
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
CHALLENGES OF ANN
Major Problems
Overfitting
Underfitting
Difficult parameter tuning
Real-world generalization issues
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
MOST IMPORTANT EXAM TOPICS
Bayes Theorem
Naïve Bayes Algorithm
Laplace Correction
Gaussian Naïve Bayes
Artificial Neuron
Activation Functions
Perceptron Model
XOR Problem
Delta Learning Rule
ANN Types
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
FAST REVISION PLAN
First 2 Hours
Learn:
• Bayes Theorem
• Naïve Bayes
• MAP & ML Hypothesis
• Gaussian Naïve Bayes
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Next 2 Hours
Learn:
• Artificial Neuron
• ANN Structure
• Activation Functions
• Perceptron
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━
Final 2 Hours
Learn:
• Delta Rule
• XOR Problem
• ANN Types
• Applications & Limitations
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━