Save this video free

Naive Bayes: Concepts and Code

StatQuest with Josh Starmer · 1:15:20 · Watch on YouTube

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

StatQuest with Josh Starmer explains Naive Bayes classification, covering both Multinomial Naive Bayes for text and Gaussian Naive Bayes for continuous data. The video demonstrates how to implement these models in R and Python using AI assistance, highlighting the 'naive' assumption of feature independence and the practical challenges like zero probabilities, which are addressed with techniques like Laplace smoothing. The comparison of R and Python implementations shows identical results when using the same training and testing data splits.

Key takeaways

Chapters

0:00 Introduction and Audience Check-in
0:49 Introducing Naive Bayes and Its Variants
6:30 Multinomial Naive Bayes: Spam Filtering Example
10:02 Calculating Word Probabilities for Normal Messages
13:34 Calculating Word Probabilities for Spam Messages
15:46 Classifying a New Message: 'Dear Friend'
19:04 Classifying 'Dear Friend' as Spam
25:46 Handling Zero Probabilities with Laplace Smoothing
33:57 The 'Naive' Assumption of Naive Bayes
36:43 Gaussian Naive Bayes: Predicting Movie Preference
41:35 Calculating Scores for Gaussian Naive Bayes
47:06 Using Log-Likelihoods to Avoid Underflow
51:38 Comparing Gaussian Naive Bayes Scores
55:12 Coding Naive Bayes in R with AI Assistance

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:00 Is this working? [laughter] All right, getting things going. Looks like it's working. [laughter] Oh, this is always such a mystery for me. It's a little embarrassing. You'd think after all these years I'd be like the best live streamer ever, [laughter] so well rehearsed and practiced, but instead I'm like, what's going on? >> [laughter] >> Hello. So, um um looks like we've got um some people joining us, which is fantastic. Uh why don't you just I'm I'm in North Carolina. Uh so, why don't you tell us where you

0:46 guys are watching from? It's always fun to kind of see where people are are are watching. Um is everybody else in Chapel Hill, North Carolina? [laughter] [gasps] Am I is everyone here or or we all spread out? So just it may be in the chat. I'm in Chapel Hill, North Carolina. Where are you? So we'll just get that started while I putt around with the screen and tune up my ukulele because you know can't have an out of tune ukulele for a silly song. Oh, we got someone from Germany, someone in India. That's exciting. Kansas City, Missouri. Holy smokes. Barbecue capital of the Midwest. China. Blaine, Minnesota. I was just in

1:32 Minnesota. Cologne, Austin, Texas, Chicago, Maryland. Go Turpps. Trinidad, Vienna, Austria. Wow, that's exciting. UK, Houston, Italy. Oh, hooray. We got all kinds of people here. Um, Chicago, we got some more Chicago. Delhi, India. Awesome. >> [music] >> Hooray. [laughter] Cordova. Holy smokes. No way. Uh, Colombia. I just learned uh that the best way to annoy a Colombian is to say that arapas are from Venezuela. Antarctica. No way. Is that for real? I wish you could upload a screenshot or a picture to prove it. Holy smokes. That's a new one for me. [music]

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, StatQuest with Josh Starmer.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.