Email Spam Perceptron Example
Email Spam Perceptron Example
Detection
Using a Perceptron - Step-by-Step
Problem Setup
• Goal: Classify emails as Spam (1) or Not Spam
(0) using features:
• - x1: 'FREE' in email
• - x2: 'CLICK' in email
• - x3: Subject line in ALL CAPS
Inputs and Initial Weights
• Example 1:
• - x1 = 1 (Yes)
• - x2 = 1 (Yes)
• - x3 = 0 (No)
• Weights:
• - w1 = 0.5
• - w2 = 0.4
• - w3 = 0.3
Compute Weighted Sum
• Weighted Sum = (0.5×1) + (0.4×1) + (0.3×0) +
(-0.6)
• = 0.3
Activation and Output
• Step Activation Function:
• If Weighted Sum ≥ 0, Output = 1 (Spam)
• If Weighted Sum < 0, Output = 0 (Not Spam)