Skip to content

Add interactive lesson on overfitting vs underfitting - #4

Merged
LMK89 merged 1 commit into
mainfrom
claude/intelligent-davinci-xpejtt
Aug 23, 2026
Merged

Add interactive lesson on overfitting vs underfitting#4
LMK89 merged 1 commit into
mainfrom
claude/intelligent-davinci-xpejtt

Conversation

@LMK89

@LMK89 LMK89 commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Summary

Added a comprehensive educational lesson on overfitting and underfitting concepts with interactive visualizations and real polynomial fitting examples.

Key Changes

  • New lesson file: 2026-08-22-overfitting-underfitting-c4cf9012.html

    • Complete standalone HTML lesson with embedded CSS and JavaScript
    • Vietnamese language content targeting beginners in machine learning
  • Content sections:

    • Conceptual overview of bias-variance tradeoff with ASCII diagram
    • Four model states demonstrated with real least-squares polynomial fits (degree 1, 3, 7, and 7 with Ridge regularization)
    • Comparison table summarizing underfitting, good fit, overfitting, and regularized scenarios
    • Interactive demo allowing users to adjust regularization strength (λ) and observe MSE changes
    • Real-world examples of good vs bad datasets
    • Practice exercise with answer reveal
    • 4-question quiz with immediate feedback
  • Interactive features:

    • Canvas-based visualization of fitted curves with progressive animation
    • Real computed coefficients from polynomial fitting (not fabricated data)
    • Live regularization strength slider with precomputed Ridge regression results
    • Theme toggle (light/dark mode) with system preference detection
    • Intersection Observer for scroll-triggered animations
    • Responsive design with mobile support
  • Updated README: Added entry for the new lesson in the course index table

Implementation Details

  • Uses real polynomial fitting data (8 training points, 4 test points) with actual least-squares coefficients
  • Canvas rendering with device pixel ratio support for crisp graphics
  • Precomputed Ridge regression results at λ = 0, 0.001, 0.1, 1, 5 for the demo
  • CSS custom properties for theming with automatic dark mode detection
  • Vanilla JavaScript (no external dependencies) for interactivity
  • Accessible form controls with proper ARIA labels

https://claude.ai/code/session_01S64DiCZUs6hmhhxSBjVfAH

Bốn trạng thái model (underfit bậc 1, vừa đủ bậc 3, overfit bậc 7,
overfit + Ridge L2) fit trên cùng dataset thật bằng least-squares,
kèm demo tương tác kéo lambda và quiz tự chấm.
@LMK89
LMK89 merged commit 2f18121 into main Aug 23, 2026
@LMK89
LMK89 deleted the claude/intelligent-davinci-xpejtt branch August 25, 2026 07:17
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