Skip to content

Commit 05f0327

Browse files
committed
first pass at page for 187 bayes
1 parent f8a210b commit 05f0327

File tree

1 file changed

+122
-0
lines changed
  • content/videos/challenges/187-bayesian-text-classification

1 file changed

+122
-0
lines changed
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
"title": "Bayesian Text Classification",
3+
"description": "In this coding challenge, I struggle my way through implementing a Naive Bayes text classifier in JavaScript using p5.js. I explain Bayes' theorem, demonstrate word frequency analysis, implement Laplacian smoothing, and build a working sentiment classifier that runs entirely in the browser.",
4+
"videoNumber": "187",
5+
"videoId": "g3-PXyF8U70",
6+
"date": "2025-10-11",
7+
"languages": ["JavaScript", "p5.js"],
8+
"topics": [
9+
"Bayes theorem",
10+
"text classification",
11+
"naive Bayes",
12+
"sentiment analysis",
13+
"natural language processing",
14+
"machine learning",
15+
"word frequency",
16+
"Laplacian smoothing"
17+
],
18+
"canContribute": true,
19+
"relatedChallenges": ["40-word-counter", "42-markov-chain-name-generator"],
20+
"timestamps": [
21+
{ "time": "0:00:00", "title": "Hello!" },
22+
{ "time": "0:03:37", "title": "Explaining Bayes' Theorem" },
23+
{ "time": "0:12:07", "title": "What is Naive Bayes?" },
24+
{ "time": "0:13:48", "title": "Setting up the Classifier in p5.js" },
25+
{ "time": "0:15:41", "title": "Coding the Word Counting Algorithm" },
26+
{ "time": "0:21:22", "title": "Training the Classifier with Data" },
27+
{ "time": "0:22:14", "title": "Coding the Classify Function" },
28+
{ "time": "0:25:20", "title": "Refactoring the Data Structure" },
29+
{ "time": "0:29:06", "title": "Implementing Probability Calculations" },
30+
{ "time": "0:33:24", "title": "Laplacian (Additive) Smoothing" },
31+
{ "time": "0:42:21", "title": "Ignoring the Denominator (Normalization)" },
32+
{ "time": "0:45:36", "title": "Quick User Interface" },
33+
{ "time": "0:49:42", "title": "Final thoughts" }
34+
],
35+
"codeExamples": [
36+
{
37+
"title": "Text Classifier - Initial Version",
38+
"description": "Raw (but corrected) version in p5.js web editor.",
39+
"urls": {
40+
"p5": "https://editor.p5js.org/codingtrain/sketches/RZ8a1z4DN"
41+
}
42+
},
43+
{
44+
"title": "Text Classifier - Refactored Version",
45+
"description": "Refactored version with better structure and comments.",
46+
"urls": {
47+
"p5": "https://editor.p5js.org/codingtrain/sketches/P3ngrAANX",
48+
"other": "https://github.com/Programming-from-A-to-Z/bayes-classifier-js"
49+
}
50+
},
51+
{
52+
"title": "Text Classifier - File Loading Version",
53+
"description": "Version that loads training data from three novels (romance, horror, sci-fi).",
54+
"urls": {
55+
"p5": "https://editor.p5js.org/codingtrain/sketches/WowR2Q9xg"
56+
}
57+
}
58+
],
59+
"groupLinks": [
60+
{
61+
"title": "References",
62+
"links": [
63+
{
64+
"icon": "📓",
65+
"title": "Naive Bayes Classifier",
66+
"url": "https://en.wikipedia.org/wiki/Naive_Bayes_classifier",
67+
"description": "Wikipedia article explaining naive Bayes classification algorithms."
68+
},
69+
{
70+
"icon": "📓",
71+
"title": "Laplacian Smoothing",
72+
"url": "https://en.wikipedia.org/wiki/Additive_smoothing",
73+
"description": "Wikipedia article about additive (Laplacian) smoothing technique."
74+
}
75+
]
76+
},
77+
{
78+
"title": "Videos",
79+
"links": [
80+
{
81+
"icon": "🚂",
82+
"title": "Word Counting",
83+
"url": "/challenges/40-word-counter",
84+
"description": "Video series on text analysis and word counting fundamentals."
85+
},
86+
{
87+
"icon": "🚂",
88+
"title": "Regular Expressions",
89+
"url": "https://youtu.be/7DG3kCDx53c?list=PLRqwX-V7Uu6YEypLuls7iidwHMdCM6o2w",
90+
"description": "Video series covering regular expressions for text processing."
91+
},
92+
{
93+
"icon": "📺",
94+
"title": "Bayes theorem, the geometry of changing beliefs",
95+
"url": "https://youtu.be/HZGCoVF3YvM",
96+
"description": "Visual explanation of Bayes' theorem with geometric visualization from 3Blue1Brown."
97+
},
98+
{
99+
"icon": "🚂",
100+
"title": "p5.js 2.0: async and await",
101+
"url": "/tracks/p5js-2.0/p5js-2.0/async-await",
102+
"description": "Asynchronous programming in p5.js using async and await."
103+
}
104+
]
105+
},
106+
{
107+
"title": "Live Stream Archives",
108+
"links": [
109+
{
110+
"icon": "🔴",
111+
"title": "Full Live Stream",
112+
"url": "https://youtube.com/live/TsBDm0P0qaA",
113+
"description": "Complete unedited live stream showing the development process with all mistakes and problem-solving."
114+
}
115+
]
116+
}
117+
],
118+
"credits": [
119+
{ "title": "Editing", "name": "Mathieu Blanchette" },
120+
{ "title": "Animations", "name": "Jason Heglund" }
121+
]
122+
}

0 commit comments

Comments
 (0)