Skip to content

Add Naive Bayes spam filter interactive lesson in Vietnamese - #13

Merged
LMK89 merged 1 commit into
mainfrom
claude/quirky-planck-q2z0w0
Aug 31, 2026
Merged

Add Naive Bayes spam filter interactive lesson in Vietnamese#13
LMK89 merged 1 commit into
mainfrom
claude/quirky-planck-q2z0w0

Conversation

@LMK89

@LMK89 LMK89 commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Summary

Added a comprehensive interactive educational lesson on Naive Bayes classification for spam filtering, written in Vietnamese. The lesson includes theoretical explanations, practical demonstrations, and interactive quizzes.

Key Changes

  • New lesson file: 2026-08-30-naive-bayes-spam-filter-201288cf.html (629 lines)

    • Complete HTML5 document with embedded CSS and JavaScript
    • Dark/light theme toggle with localStorage persistence
    • Responsive design using CSS Grid and Flexbox
  • Content sections:

    • Quick warmup quiz (3 questions) to assess prior knowledge
    • Formal definition of Naive Bayes and Bayes' theorem
    • Real-world email spam classification problem with training data table
    • Four detailed state comparisons:
      • Zero-frequency problem (without Laplace smoothing)
      • Laplace smoothing solution (add-1)
      • Numerical underflow issues (direct multiplication vs log-probability)
      • Imbalanced class priors
    • Interactive demo calculator showing step-by-step probability calculations
    • Data quality guidelines (good vs bad datasets)
    • Self-grading quiz with 3 conceptual questions
  • Interactive features:

    • Checkbox selection for email keywords
    • Radio buttons for smoothing mode toggle
    • Real-time calculation with animated step-by-step output
    • Random email generator for testing
    • Immediate feedback on quiz answers
    • Responsive form inputs and buttons
  • Updated README.md: Added entry for the new lesson in the course index table

Implementation Details

  • Uses CSS custom properties (CSS variables) for theming
  • Implements smooth animations (fadeInDown, slideUp, slideDown, pulse)
  • JavaScript calculations based on training data: 4 spam emails and 4 ham emails with 6 keywords
  • Demonstrates both problematic (zero-frequency) and correct (Laplace smoothing) approaches
  • Educational focus on practical pitfalls: smoothing, numerical stability, and class imbalance

https://claude.ai/code/session_01Dd4TgW5XR5AP1GNyEGeJ8k

Covers zero-frequency problem, Laplace smoothing, numerical
underflow (log-probability), and imbalanced prior — with
step-by-step interactive demo and self-graded quiz.
@LMK89
LMK89 merged commit 355ba18 into main Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants