StatQuest: Logistic Regression

2.31M views1111 WordsCopy TextShare
StatQuest with Josh Starmer
Logistic regression is a traditional statistics technique that is also very popular as a machine lea...
Video Transcript:
If you can fit a line you can fit a squiggle if you can, make me laugh you can, make me giggle stat quest Hello, i'm josh stormer and welcome to stat quest today we're going to talk about logistic regression This is a technique that can be used for traditional statistics as, well as machine learning so let's get right to it Before we dive into logistic regression let's take. A, step back and review, linear regression in Another stat quest, we talked, about linear regression We had some data Weight and size then, we fit a line to it and With that line, we could do a lot of things First we could calculate r-squared and determine if weight and size are correlated large values imply a large effect, and Second calculate a p-value to determine if the r-squared value is statistically significant and Third, we could use the line, to predict, size given weight if a, new, mouse has this weight Then this, is the size that, we predict, from the weight although We didn't mention it at the time using data to predict something falls under the category of machine learning So plain old linear regression is a form of machine learning We also talked a little bit about multiple regression Now, we are trying to predict, size, using weight and blood volume Alternatively we could, say that, we are trying to model size using weight and blood volume Multiple regression, did the same things that normal regression did we calculated r-squared and we calculated the p-value and We could predict, size, using weight and blood volume and This, makes multiple regression a slightly fancier machine learning method We also talked, about how, we can use discrete measurements like genotype to predict size if you're Not familiar with the term genotype don't freak out it's. No, big deal just know that it refers to different types of mice lastly, we could compare models So on the left side we've got normal regression, using weight to predict size and We can, compare those predictions to the ones, we get from multiple regression, where we're using weight and blood volume to predict size Comparing the simple model to the complicated one tells us if we need to measure weight and blood volume to accurately predict Size or if we can get, away, with just weight Now that we remember all the cool, things, we can, do with linear regression Let's talk, about logistic regression Logistic regression is similar to linear regression except Logistic regression predicts whether something, is true or false instead of predicting something continuous, like, sighs these mice are obese and These mice are not Also instead of fitting a line to the data logistic regression fits an s-shaped logistic function The curve goes from zero to one?
And that, means that the curve tells you the probability that a mouse is obese based on its weight If we weighed a very heavy mouse? There is a high probability that the new, mouse is obese? If we weighed an intermediate mouse Then there is only a 50% chance of the mouse is obese?
Lastly, there's only a small probability that a light mouse is obese Although, logistic regression, tells the probability that a mouse is obese or not it's usually used for classification For example if the probability of mouse is obese is greater than 50% Then we'll classify it as obese Otherwise we'll classify it as not obese Just like with linear regression, we can, make simple models in this case, we can have obesity predicted, by weight or? more complicated models in this case obesity is predicted by weight and genotype in This, case, obesity is predicted. By weight and genotype and age and Lastly, obesity is predicted by weight genotype, age and Astrological sign in other words just like linear regression logistic Regression can work with continuous data, like weight and age and discrete data like genotype and astrological sign We can, also test to see if each variable is useful for predicting obesity however Unlike normal regression, we can't easily compare the complicated model to the simple model and we'll talk more about, why in a bit Instead we just test to see if a variables affect on the prediction is significantly different from zero If not it, means that the variable is not helping the prediction We use, wald's tests to figure this out we'll talk, about that in another stat quest in This, case, the astrological sign is totes useless That statistical jargon for not helping That, means we can, save time and space in our study.
By leaving it out Logistic regressions ability to provide probabilities and classify, new samples using continuous and discrete measurements Makes it a popular machine learning method One big difference between linear regression and logistic regression is how the line is fit to the data With linear regression, we fit the line, using least squares In other words, we find the line that minimizes the sum of the squares of these residuals We also use the residuals to calculate r. Squared and to compare simple models to complicated models Logistic regression doesn't have the same concept of a residual so it can't use least squares and it can't calculate r squared instead it uses something called maximum likelihood There's a whole stack quest on maximum likelihood so see that for details but in a nutshell You, pick a probability scaled.
Related Videos
Logistic Regression Details Pt1: Coefficients
19:02
Logistic Regression Details Pt1: Coefficients
StatQuest with Josh Starmer
944,288 views
Linear Regression, Clearly Explained!!!
27:27
Linear Regression, Clearly Explained!!!
StatQuest with Josh Starmer
310,922 views
Support Vector Machines Part 1 (of 3): Main Ideas!!!
20:32
Support Vector Machines Part 1 (of 3): Mai...
StatQuest with Josh Starmer
1,448,491 views
Logistic Regression [Simply explained]
14:22
Logistic Regression [Simply explained]
DATAtab
213,565 views
p-values: What they are and how to interpret them
11:21
p-values: What they are and how to interpr...
StatQuest with Josh Starmer
1,206,672 views
Regression Analysis | Full Course
45:17
Regression Analysis | Full Course
DATAtab
865,662 views
StatQuest: Principal Component Analysis (PCA), Step-by-Step
21:58
StatQuest: Principal Component Analysis (P...
StatQuest with Josh Starmer
3,052,081 views
In Statistics, Probability is not Likelihood.
5:01
In Statistics, Probability is not Likelihood.
StatQuest with Josh Starmer
1,298,711 views
Gradient Descent, Step-by-Step
23:54
Gradient Descent, Step-by-Step
StatQuest with Josh Starmer
1,448,303 views
ROC and AUC, Clearly Explained!
16:17
ROC and AUC, Clearly Explained!
StatQuest with Josh Starmer
1,595,562 views
Learn Statistical Regression in 40 mins! My best video ever. Legit.
40:25
Learn Statistical Regression in 40 mins! M...
zedstatistics
296,269 views
Multivariable Logistic Regression in R: The Ultimate Masterclass (4K)!
18:14
Multivariable Logistic Regression in R: Th...
yuzaR Data Science
5,948 views
All Learning Algorithms Explained in 14 Minutes
14:10
All Learning Algorithms Explained in 14 Mi...
CinemaGuess
288,249 views
Linear Regression vs Logistic Regression | Data Science Training | Edureka
20:27
Linear Regression vs Logistic Regression |...
edureka!
429,966 views
Locally Weighted & Logistic Regression | Stanford CS229: Machine Learning - Lecture 3 (Autumn 2018)
1:19:34
Locally Weighted & Logistic Regression | S...
Stanford Online
616,027 views
Naive Bayes, Clearly Explained!!!
15:12
Naive Bayes, Clearly Explained!!!
StatQuest with Josh Starmer
1,128,800 views
Logistic regression : the basics - simply explained
20:25
Logistic regression : the basics - simply ...
TileStats
38,689 views
Regularization Part 1: Ridge (L2) Regression
20:27
Regularization Part 1: Ridge (L2) Regression
StatQuest with Josh Starmer
1,144,372 views
Logistic Regression in R, Clearly Explained!!!!
17:15
Logistic Regression in R, Clearly Explaine...
StatQuest with Josh Starmer
530,969 views
Maximum Likelihood, clearly explained!!!
6:12
Maximum Likelihood, clearly explained!!!
StatQuest with Josh Starmer
1,502,514 views
Copyright © 2025. Made with ♥ in London by YTScribe.com