Tutorial 35- Logistic Regression Indepth Intuition- Part 1| Data Science
Key Takeaways
Explains logistic regression with in-depth intuition
Full Transcript
[Music] hello my name is Krishna and welcome to my youtube channel this is the 35th tutorial in machine learning complete machine learning playlist and I had promised you guys I'd be completing all the machine learning algorithms they are awesome for a 15 to 20 machine learning algorithms which are like completely and uploading in my specific playlist that is called as complete machinery playlist similarly I have plans to upload the remaining videos in deep learning playlist also and this was one of the most requests and you want it in depth inclusion then why why I am actually uploading this particular videos nice is that to explain you the complete maths you know what is the mass behind the machine learning algorithms and some of the machine learning algorithm may go through some some different parts you know this is the part one suppose in logistically Ellucian I am planning to complete it in part twos you know so part 1 and part 2 in part 1 and part 2 in part 1 we will try to understand what exactly is logistically duration you know why discord has launched integration and in the part 2 will understand the maths behind it you know here also will be understanding some of the Macs now this intuition is pretty much is important because as you all know that implementation with the help of fight them by using libraries like a scalar is pretty much simple and I've also shown in many videos how you can actually do hyper parameter optimization many more things so it is very very important to understand the math we are in time because that will actually help you in doing the hyper parameter optimization and in the interview right they meet they they'll basically ask you the math behind this personal particular machine learning algorithm so in this specific video we're trying to understand about logistic regression this will be divided into two parts this is part one so make sure that you understand this particularly now guys if you are looking for career transition and watched was data science please make sure that he was this particular video till the end because I am going to show you some of the important things at the end of this particular video so let us go ahead and try to understand how does large signal regression actually work now understand one thing guys first of all why this algorithm actually used this is the machine learning about them so in logistically aggression it is basically used for binary classification now I grew up in my tutorial thirty first I have actually uploaded videos regarding linear regression and we understood the various metrics like R squared R square errors everything we try to understand in that right but in binary classification now that was a regression kind of problem straightener logistic regression is basically a binary classification problem statement but why it is called as a technician okay now see very important thing over here is that let me take a very very simple use case now if I why in my x axis I have a parameter called as weight so this is not X value okay and this is my Y value so let me just write it down this is my X this is my Y value now this way based on the way I am categorizing people into not obese and movies that basically means that if the weight is more than this particular value suppose I say that this is this is somewhere around 75 if it is greater than 75 right I am saying that all these particular values becomes obese that person is actually obese if is less than 75 I am just considering it as not obese okay this is the data that said that I am having okay now just understanding this as an example okay now if you want to try to classify this based on weight suppose tomorrow I have a greater way here okay suppose this is my LD weight I should be able to classify whether the person is obese whether the person is not obese right so for this is how to be sorted first of all let us think over here okay now as I told you large string regulation is a classification problem now first of all and the name regression is there okay name regression is there can we solve this particular problem statement with the help of linear regression and what is linear regression remember guys linear regulation is nothing but we try to draw a straight line such that the distance between this points right the summation of the distance between this point and that particular minimum okay that is what linear relation is we have learned that in our previous classes and that straight line that plane is basically denoted as y is equal to MX plus C and is also denominated by s theta of X is equal to theta 0 plus theta 1 u 2 X or it is also denoted by beta 0 plus beta 1 into X write different different notation in other and one notation is also something like this the true transpose multiplied by X plus B is equal to Y right now what does this basically me so this is my slope okay these are my data points C is the intercept right this is this is what we understood in the linear regulation right these are some basic things that we need to understand right and all the explanation is before now based on that suppose I created my best fit line which looks something like this suppose I created my best fit line will look something like this right now understand one thing when I'm creating this best fit line you know that this is 0 1 1 the middle value is actually point five so this is nine point seven now what I can say is that suppose I want to check it for 75kg what is the output right now with respect to 75kg if I go and point at this particular point it is somewhere around 0.5 right it is only around point 5 now what I can do is that I can basically write a condition for this edge treat of X which is denoted this particular equation that is the equation of the straight line if this value is greater than or equal to 0.5 I will consider this as one that disagreement it will become obese the person with rate of 75 kg which is actually obese right if it is less than 0.05 then it will become not obese so that basically means suppose if I'm considering this way 60 kg and if I just try to populate this right over here so this will be my probability value that I will get suppose this by 3 right so it is less than 0.5 so I am going to consider that 60 kg that person is going to become not obese right pretty much simple now with the help of the straight line to classify easily right so what is the use of large circulation that is the next question that comes up right it is pretty much important to understand you can see where by just creating a straight line now suppose my new data point comes over here okay sorry for this the whole 9u Teina pora's comes up comes over here now I need to find out I just go and this is greater than quite fine I can definitely say that this person is not obese sorry this person is obese suppose if I want to find out to me why are you over here I may go over here and find out this is my son it will be negative value okay so somewhere we though it is less than point five so I am going to consider that the person is not obese right and this gets extended over here like this so I can find out this particular point it will be negative so just by considering a straight line I can solve the classification problem so why exactly do we need require not segregation now I understand one thing now suppose I see that there is one more outlier added to it suppose my outlier is somewhere here just consider this my outline has gone somewhere here right now if I try to create this best fit line once again what had happened this better straight line do not change it will become something like this right now this is my new best fit line as Street of X right next it out next this is my new best fit line but now I understand this problem statement guys we know that if the person is greater than 75 kg we should classify this as obese category but now if I go and see my 75 person with respect to this best fit line that I have it is coming somewhere over here my point 3 now that basically means that a person with 75 kg right it's really not obese but this is this was not what the result we actually wanted right because we clearly know that this particular points in my training data is basically having obese category but but just by the inclusion of one out one point the whole straight line became deviated because this is the best Whitman and this is actually computed based on the distance right now you have understood that because of this this holds best fit line has changed and because of that there is a high error rate now because of this we should not use linear regression for this kind of classification problem now this is the major major problem with linear regression because every time we have to create a best fit line based on the data points that we have and we know clearly that this particular points are OBEs but with the help of this best fit line what has happened now suppose if I take this point five it is pointed over here I'll draw it over here okay so this all points will get cut incorrectly classified right so this all points will get correctly classified that is fine but this all points will get indirectly classified which is a very very big problem over here right so because of that we should never use linear regression for this particular binary classification okay then what should we do then right there is one more problem with linear reduction now I understand over here guys suppose my grade is somewhere here and this particular line is getting extended here now if I try to find out with respect to this particular weight what is my value right now the answer is greater than one right but we have told that if the value is greater than point five okay we are going to consider this because the maximum value is one right we are going to consider one but if it is greater than one what do we consider now similarly if it is less than 0.5 suppose this is my point and with respect to this I am extending it downwards right now suppose if I consider this part I am going to populate it this is my negative value right now when I am a negative value it is less than 0 1 is greater than 1 1 is less than 0 what do we consider for that so instead we should try to divide this line like this and this is basically done by a sigmoid function which I explaining in my next class will there will be lot of maths we have just understood why linear regression will not work for the specific problem statement right and let it be interesting guys because I am going to include each and every bit of maths you know you know much more easy way so that you will be able to understand it right so two reasons why linear regression should not be used for this binary classification this one is that whenever I have a lot of points or outliers the best fit line will completely get deviated the second thing is that whatever output I am getting most of the time I am getting greater than 1 less than 0 so in order to solve this particular problem we have to use logistically division and large ticket irrigation uses a very very simple concept along with the function which is called a sigmoid function which will squash this straight line but before squashing we need to understand how this best fit line so basically if I talk about large single regression it will create a lamp which looks like this but we need to understand how this curve will get cleared if this curve is pretty much important what is the math behind this particular curve we can basically say that this straight line will get created with the equation 1 divided by 1 plus e to the power of minus X which is also called as a sigmoid function this is also used in deep learning but how this particular curve is actually created that we need to understand and that will try to understand in the next class so before entering this particularly this varies if you're looking for care a transition is much too much data science please make sure that you watch the YouTube channel of spring food in India because there you will be able to see stalks of railway data scientists were working in different different dimension seas the link is basically given in the description of this particular video so this was all about this particular video I hope you liked it please do subscribe the channel beyond modern devices cars the next video have a great day thank you monitor
Original Description
If you are looking for Career Transition Advice please check the below link
Springboard India Youtube link: https://www.youtube.com/channel/UCg5UINpJgS4uqWZkv2Qh1Mw
Please join as a member in my channel to get additional benefits like materials in Data Science, live streaming for Members and many more
https://www.youtube.com/channel/UCNU_lfiiWBdtULKOw6X0Dig/join
Please do subscribe my other channel too
https://www.youtube.com/channel/UCjWY5hREA6FFYrthD0rZNIw
Connect with me here:
Twitter: https://twitter.com/Krishnaik06
Facebook: https://www.facebook.com/krishnaik06
instagram: https://www.instagram.com/krishnaik06
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Krish Naik · Krish Naik · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Natural Language Processing|Stemming
Krish Naik
Natural Language Processing|BagofWords
Krish Naik
Gaussian distribution or Normal Distribution in statisctics
Krish Naik
Natural Language Processing|TF-IDF for Machine Learning| Text Prerocessing
Krish Naik
Log Normal Distribution in Statistics
Krish Naik
Covariance in Statistics
Krish Naik
Confusion matrix, Precision, Recall| Data Science Interview questions
Krish Naik
Tutorial 44-Balanced vs Imbalanced Dataset and how to handle Imbalanced Dataset
Krish Naik
Implementing a Spam classifier in python| Natural Language Processing
Krish Naik
Tutorial 11-Exploratory Data Analysis(EDA) of Titanic dataset
Krish Naik
Face Recognition using open CV and VGG 16 Transfer Learning
Krish Naik
Pedestrian Detection using OpenCV from Videos
Krish Naik
Face and Eye Detection from Videos using HAAR Cascade Classifier
Krish Naik
Reading, Writing and Displaying images with Opencv| OpenCV Tutorial
Krish Naik
OpenCV Installation | OpenCV tutorial
Krish Naik
Face and Eye Detection from Images using HAAR Cascade Classifier
Krish Naik
Car Detection using HAAR Cascade and Opencv from Videos.
Krish Naik
Using OpenFace for Face recognition in Keras
Krish Naik
OpenPose Tutorial with Tensorflow
Krish Naik
Multiple Linear Regression using python and sklearn
Krish Naik
Dimensional Reduction| Principal Component Analysis
Krish Naik
Movie Recommender System using Python
Krish Naik
TPR,FPR,FNR,TNR, Confusion Matrix
Krish Naik
Precision, Recall and F1-Score
Krish Naik
Artificial Neural Network for Customer's Exit Prediction from Bank
Krish Naik
GridSearchCV- Select the best hyperparameter for any Classification Model
Krish Naik
RandomizedSearchCV- Select the best hyperparameter for any Classification Model
Krish Naik
K Nearest Neighbor classification with Intuition and practical solution
Krish Naik
K Means Clustering Intuition
Krish Naik
Create custom Alexa Skill- Lambda function- Part2
Krish Naik
Hierarchical Clustering intuition
Krish Naik
Implement Transfer Learning with a generic Code Template
Krish Naik
Gender Classifier and Age Estimator using Resnet Convolution Neural Network
Krish Naik
Unlock Your Application With Your Face using OpenCV
Krish Naik
Draw rectangle from webcam and sketch process it on a live feed
Krish Naik
Complete Life Cycle of a Data Science Project
Krish Naik
How we can apply Machine Learning in Finance
Krish Naik
Deep Learning in Medical Science
Krish Naik
How to switch your career to Data Science.
Krish Naik
Linear Regression Mathematical Intuition
Krish Naik
Handle Categorical features using Python
Krish Naik
Machine Learning Algorithm- Which one to choose for your Problem?
Krish Naik
DBSCAN Clustering Easily Explained with Implementation
Krish Naik
Curse of Dimensionality Easily explained| Machine Learning
Krish Naik
Feature Selection Techniques Easily Explained | Machine Learning
Krish Naik
Tutorial 29-R square and Adjusted R square Clearly Explained| Machine Learning
Krish Naik
Cross Validation using sklearn and python | Machine Learning
Krish Naik
Handling Missing Data Easily Explained| Machine Learning
Krish Naik
Deploy Machine Learning Model using Flask
Krish Naik
Deployment of Deep Learning Model using Flask
Krish Naik
How to Visualize Multiple Linear Regression in python
Krish Naik
K Nearest Neighbour Easily Explained with Implementation
Krish Naik
Predicting Heart Disease using Machine Learning
Krish Naik
Predicting Lungs Disease using Deep Learning
Krish Naik
Stock Sentiment Analysis using News Headlines
Krish Naik
Random Forest(Bootstrap Aggregation) Easily Explained
Krish Naik
Voting Classifier(Hard Voting and Soft Voting Classifier)
Krish Naik
Credit Card Fraud Detection using Machine Learning from Kaggle
Krish Naik
Hyperparameter Optimization for Xgboost
Krish Naik
Tutorial 45-Handling imbalanced Dataset using python- Part 1
Krish Naik
Related Reads
📰
📰
📰
📰
AI-Ready Infrastructure: A Checklist Before You Scale
Dev.to AI
How I Cut My OpenAI Bill by 97% — The Full Migration Guide
Dev.to · rarenode
Your Website Passed Claude’s Search Test. It Might Still Fail the Other Two
Medium · AI
AI Made Creation Free. Taste Is What's Scarce Now
Forbes Innovation
🎓
Tutor Explanation
DeepCamp AI