title
Logistic Regression in R | Machine Learning Algorithms | Data Science Training | Edureka

description
( Data Science Training - https://www.edureka.co/data-science-r-programming-certification-course ) This Logistic Regression Tutorial shall give you a clear understanding as to how a Logistic Regression machine learning algorithm works in R. Towards the end, in our demo, we will be predicting which patients have diabetes using Logistic Regression! In this Logistic Regression Tutorial video you will understand: 1) The 5 Questions asked in Data Science 2) What is Regression? 3) Logistic Regression - What and Why? 4) How does Logistic Regression Work? 5) Demo in R: Diabetes Use Case 6) Logistic Regression: Use Cases Subscribe to our channel to get video updates. Hit the subscribe button above. Check our complete Data Science playlist here: https://goo.gl/60NJJS #LogisticRegression #Datasciencetutorial #Datasciencecourse #datascience How it Works? 1. There will be 30 hours of instructor-led interactive online classes, 40 hours of assignments and 20 hours of project 2. We have a 24x7 One-on-One LIVE Technical Support to help you with any problems you might face or any clarifications you may require during the course. 3. You will get Lifetime Access to the recordings in the LMS. 4. At the end of the training you will have to complete the project based on which we will provide you a Verifiable Certificate! - - - - - - - - - - - - - - About the Course Edureka's Data Science course will cover the whole data life cycle ranging from Data Acquisition and Data Storage using R-Hadoop concepts, Applying modelling through R programming using Machine learning algorithms and illustrate impeccable Data Visualization by leveraging on 'R' capabilities. - - - - - - - - - - - - - - Why Learn Data Science? Data Science training certifies you with ‘in demand’ Big Data Technologies to help you grab the top paying Data Science job title with Big Data skills and expertise in R programming, Machine Learning and Hadoop framework. After the completion of the Data Science course, you should be able to: 1. Gain insight into the 'Roles' played by a Data Scientist 2. Analyse Big Data using R, Hadoop and Machine Learning 3. Understand the Data Analysis Life Cycle 4. Work with different data formats like XML, CSV and SAS, SPSS, etc. 5. Learn tools and techniques for data transformation 6. Understand Data Mining techniques and their implementation 7. Analyse data using machine learning algorithms in R 8. Work with Hadoop Mappers and Reducers to analyze data 9. Implement various Machine Learning Algorithms in Apache Mahout 10. Gain insight into data visualization and optimization techniques 11. Explore the parallel processing feature in R - - - - - - - - - - - - - - Who should go for this course? The course is designed for all those who want to learn machine learning techniques with implementation in R language, and wish to apply these techniques on Big Data. The following professionals can go for this course: 1. Developers aspiring to be a 'Data Scientist' 2. Analytics Managers who are leading a team of analysts 3. SAS/SPSS Professionals looking to gain understanding in Big Data Analytics 4. Business Analysts who want to understand Machine Learning (ML) Techniques 5. Information Architects who want to gain expertise in Predictive Analytics 6. 'R' professionals who want to captivate and analyze Big Data 7. Hadoop Professionals who want to learn R and ML techniques 8. Analysts wanting to understand Data Science methodologies For more information, Please write back to us at sales@edureka.co or call us at IND: 9606058406 / US: 18338555775 (toll free). Instagram: https://www.instagram.com/edureka_learning/ Facebook: https://www.facebook.com/edurekaIN/ Twitter: https://twitter.com/edurekain LinkedIn: https://www.linkedin.com/company/edureka Customer Reviews: Gnana Sekhar Vangara, Technology Lead at WellsFargo.com, says, "Edureka Data science course provided me a very good mixture of theoretical and practical training. The training course helped me in all areas that I was previously unclear about, especially concepts like Machine learning and Mahout. The training was very informative and practical. LMS pre recorded sessions and assignmemts were very good as there is a lot of information in them that will help me in my job. The trainer was able to explain difficult to understand subjects in simple terms. Edureka is my teaching GURU now...Thanks EDUREKA and all the best. "

detail
{'title': 'Logistic Regression in R | Machine Learning Algorithms | Data Science Training | Edureka', 'heatmap': [{'end': 755.048, 'start': 705.976, 'weight': 0.708}, {'end': 2376.625, 'start': 2196.228, 'weight': 0.785}, {'end': 2619.027, 'start': 2529.656, 'weight': 0.979}, {'end': 3197.771, 'start': 3154.647, 'weight': 0.734}, {'end': 3369.869, 'start': 3319.38, 'weight': 0.739}], 'summary': 'This tutorial covers logistic regression, fundamental data science questions, binary classification, predictive modeling, diabetic prediction model creation, model optimization, diabetes probability prediction, model accuracy, and logistic regression applications, achieving 86.7% accuracy after threshold optimization.', 'chapters': [{'end': 59.318, 'segs': [{'end': 59.318, 'src': 'embed', 'start': 0.109, 'weight': 0, 'content': [{'end': 1.93, 'text': 'Hey guys, this is Hemant from Edureka.', 'start': 0.109, 'duration': 1.821}, {'end': 5.132, 'text': "Today's session is going to be on logistic regression.", 'start': 2.35, 'duration': 2.782}, {'end': 11.415, 'text': "So without wasting any more time, let's move on to today's agenda to understand what all will be covered in today's session.", 'start': 5.632, 'duration': 5.783}, {'end': 17.972, 'text': "So we'll start off today's session by discussing the five main questions which can be asked to you in data science.", 'start': 12.489, 'duration': 5.483}, {'end': 22.634, 'text': 'Now, based on these questions, you decide which algorithm to use right?', 'start': 18.132, 'duration': 4.502}, {'end': 30.378, 'text': "So we'll see how regression fits into these questions and then we'll move on to the part where we'll be discussing what regression is exactly.", 'start': 23.095, 'duration': 7.283}, {'end': 37.182, 'text': "After that we'll move on to the topic of the day which is logistic regression and then we'll understand the what and by of logistic regression.", 'start': 30.679, 'duration': 6.503}, {'end': 48.61, 'text': "After that we'll see how logistic regression actually works And towards the end we'll be doing a demo wherein we'll be taking the diabetes data set and we'll be solving the data set using logistic regression.", 'start': 37.462, 'duration': 11.148}, {'end': 55.975, 'text': "In the end, we'll be discussing the use cases as in the real-life scenarios wherein logistic regression is actually used.", 'start': 49.01, 'duration': 6.965}, {'end': 59.318, 'text': 'Alright, so guys this is our agenda for today.', 'start': 56.455, 'duration': 2.863}], 'summary': "Today's session covers logistic regression, its applications, and a demo with a diabetes dataset.", 'duration': 59.209, 'max_score': 0.109, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk109.jpg'}], 'start': 0.109, 'title': 'Logistic regression tutorial', 'summary': 'Covers the agenda for a logistic regression tutorial, including main questions in data science, understanding regression, explaining logistic regression, demonstrating its application using a diabetes dataset, and discussing real-life use cases.', 'chapters': [{'end': 59.318, 'start': 0.109, 'title': 'Logistic regression tutorial', 'summary': 'Covers the agenda for a logistic regression tutorial, including discussing the main questions in data science, understanding regression, explaining logistic regression, demonstrating its application using a diabetes dataset, and discussing real-life use cases.', 'duration': 59.209, 'highlights': ['The session covers discussing the main questions in data science, understanding regression, and explaining logistic regression.', 'A demo will be conducted using a diabetes dataset and logistic regression to solve the data set.', 'Real-life use cases of logistic regression will be discussed.', 'The session will include understanding what regression is and how logistic regression works.', 'The agenda for the session will cover five main questions in data science and deciding which algorithm to use based on these questions.']}], 'duration': 59.209, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk109.jpg', 'highlights': ['The agenda for the session will cover five main questions in data science and deciding which algorithm to use based on these questions.', 'A demo will be conducted using a diabetes dataset and logistic regression to solve the data set.', 'The session covers discussing the main questions in data science, understanding regression, and explaining logistic regression.', 'The session will include understanding what regression is and how logistic regression works.', 'Real-life use cases of logistic regression will be discussed.']}, {'end': 408.397, 'segs': [{'end': 196.462, 'src': 'embed', 'start': 86.369, 'weight': 0, 'content': [{'end': 90.331, 'text': 'Right, so the five questions which can be asked to you are this.', 'start': 86.369, 'duration': 3.962}, {'end': 93.972, 'text': 'The first question that could be asked is is this A or B??', 'start': 90.711, 'duration': 3.261}, {'end': 97.513, 'text': 'Is this an apple or is this a pineapple??', 'start': 94.672, 'duration': 2.841}, {'end': 100.498, 'text': 'Is this A pen or is it a pencil??', 'start': 97.913, 'duration': 2.585}, {'end': 102.918, 'text': 'Is it a mouse or is it an elephant??', 'start': 100.998, 'duration': 1.92}, {'end': 109.681, 'text': 'So, when you have these kind of questions, the algorithms with these kind of questions is the classification algorithm.', 'start': 103.359, 'duration': 6.322}, {'end': 116.683, 'text': 'Alright? Our next question is, is this weird? Alright? So basically this question deals with patterns.', 'start': 110.321, 'duration': 6.362}, {'end': 120.605, 'text': 'So whenever there is a change in pattern, the algorithm detects that.', 'start': 117.284, 'duration': 3.321}, {'end': 125.947, 'text': 'And the algorithms which deals with these kind of problems are called anomaly detection algorithms.', 'start': 120.665, 'duration': 5.282}, {'end': 132.893, 'text': 'Then you have questions which are quantifiable, wherein you ask numbers how much or how many right?', 'start': 126.627, 'duration': 6.266}, {'end': 138.878, 'text': 'For example, what will be the temperature for tomorrow? Or after how many days it will rain right?', 'start': 132.933, 'duration': 5.945}, {'end': 144.364, 'text': 'So all these kind of questions are tackled by algorithms which are called regression algorithms.', 'start': 138.899, 'duration': 5.465}, {'end': 148.547, 'text': 'Then you have questions like how is this organized right?', 'start': 145.322, 'duration': 3.225}, {'end': 156.217, 'text': 'So, basically, these deals with clustering and you have, and algorithms which deals with these kind of problems are called clustering algorithms.', 'start': 148.927, 'duration': 7.29}, {'end': 160.281, 'text': 'Then you have questions, as in, what should I do next?', 'start': 156.997, 'duration': 3.284}, {'end': 170.131, 'text': "right?. So if you don't know when you have to make a decision, so decision taking capabilities are basically done by algorithms,", 'start': 160.281, 'duration': 9.85}, {'end': 172.374, 'text': 'which are called reinforcement learning.', 'start': 170.131, 'duration': 2.243}, {'end': 177.599, 'text': 'So using these algorithms you can take a decision as in what to do next.', 'start': 172.474, 'duration': 5.125}, {'end': 186.451, 'text': 'Right? So these are the five questions which are asked in data science and these are the algorithms which are made to tackle these kind of questions.', 'start': 178.34, 'duration': 8.111}, {'end': 189.816, 'text': 'Now our topic for today is logistic regression.', 'start': 187.152, 'duration': 2.664}, {'end': 193.201, 'text': 'So as the name suggests, it comes under regression algorithms.', 'start': 189.896, 'duration': 3.305}, {'end': 196.462, 'text': 'But with logistic regression, this is a scene.', 'start': 194.141, 'duration': 2.321}], 'summary': 'Data science involves 5 types of questions: classification, anomaly detection, regression, clustering, and reinforcement learning. logistic regression is a topic under regression algorithms.', 'duration': 110.093, 'max_score': 86.369, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk86369.jpg'}, {'end': 247.56, 'src': 'embed', 'start': 223.428, 'weight': 8, 'content': [{'end': 231.536, 'text': 'So it is a regression algorithm, because before classifying the output, you get a probability and based on that probability,', 'start': 223.428, 'duration': 8.108}, {'end': 237.282, 'text': 'you decide whether it will be a yes or a no, or whether it will be an A or a B.', 'start': 231.536, 'duration': 5.746}, {'end': 240.665, 'text': 'Alright, so that is the reason it is categorized under both of these algorithms.', 'start': 237.282, 'duration': 3.383}, {'end': 245.73, 'text': "Moving on, let's first understand what is regression, right?", 'start': 241.566, 'duration': 4.164}, {'end': 247.56, 'text': 'So what is regression?', 'start': 246.539, 'duration': 1.021}], 'summary': 'Regression algorithm calculates probabilities for classification decisions.', 'duration': 24.132, 'max_score': 223.428, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk223428.jpg'}, {'end': 390.547, 'src': 'embed', 'start': 345.134, 'weight': 6, 'content': [{'end': 351.818, 'text': 'So the first type of regression is the linear regression, then you have the logistic regression, and then you have the polynomial regression.', 'start': 345.134, 'duration': 6.684}, {'end': 356.258, 'text': 'Today we are going to discuss about logistic regression, right?', 'start': 352.674, 'duration': 3.584}, {'end': 361.083, 'text': "So let's move on to the part where we'll be understanding what a logistic regression is.", 'start': 356.518, 'duration': 4.565}, {'end': 365.348, 'text': "But before that let's understand where do we use logistic regression?", 'start': 361.884, 'duration': 3.464}, {'end': 368.732, 'text': 'or why is a logistic regression actually needed right?', 'start': 365.348, 'duration': 3.384}, {'end': 370.033, 'text': 'So why logistic regression??', 'start': 368.752, 'duration': 1.281}, {'end': 379.601, 'text': 'So whenever the outcome of the dependent variable is categorical or is discrete, so when I say discrete, it means the value is fixed.', 'start': 370.996, 'duration': 8.605}, {'end': 382.503, 'text': 'Can either be an A or a B.', 'start': 380.281, 'duration': 2.222}, {'end': 385.344, 'text': 'It can either be a zero or it can be a one.', 'start': 382.503, 'duration': 2.841}, {'end': 390.547, 'text': "So, if I'm asking you a question like is this animal a rat or an elephant??", 'start': 385.905, 'duration': 4.642}], 'summary': 'The logistic regression is used when the outcome of the dependent variable is categorical or discrete, such as a or b, or 0 or 1.', 'duration': 45.413, 'max_score': 345.134, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk345134.jpg'}], 'start': 59.438, 'title': 'Data science and logistic regression', 'summary': 'Covers 5 fundamental data science questions and corresponding algorithms - classification, anomaly detection, regression, clustering, and reinforcement learning. it also explains logistic regression, its categorization, and purpose in predicting categorical outcomes based on probability.', 'chapters': [{'end': 196.462, 'start': 59.438, 'title': 'Data science: 5 key questions and algorithms', 'summary': 'Discusses the five fundamental questions in data science and their corresponding algorithms, including classification, anomaly detection, regression, clustering, and reinforcement learning.', 'duration': 137.024, 'highlights': ['The chapter discusses the five fundamental questions in data science and their corresponding algorithms. The chapter highlights the five fundamental questions in data science and their corresponding algorithms, providing a comprehensive overview of the topic.', "Classification algorithms are used for questions like 'Is this A or B?' The classification algorithm is used to address questions that involve categorization, such as distinguishing between objects like apple and pineapple or pen and pencil.", 'Anomaly detection algorithms are used for questions related to detecting pattern changes. Anomaly detection algorithms are designed to identify pattern changes, providing a crucial tool for recognizing anomalies or irregularities in data.', 'Regression algorithms handle quantifiable questions involving numbers and predictions. Regression algorithms are utilized to address questions related to numerical values and predictions, such as temperature forecasts or predicting the occurrence of certain events.', 'Clustering algorithms are used to address questions related to organization and grouping. Clustering algorithms are applied to questions concerning the organization and grouping of data, providing insights into patterns and relationships within the dataset.', 'Reinforcement learning algorithms support decision-making processes. Reinforcement learning algorithms enable decision-making capabilities in situations where clear decision-making criteria may not be available, offering a valuable tool for guiding actions in uncertain environments.']}, {'end': 408.397, 'start': 197.082, 'title': 'Understanding logistic regression', 'summary': 'Explains the concept of logistic regression, its purpose, and the categorization of regression into linear, logistic, and polynomial types. logistic regression is used when the outcome of the dependent variable is categorical or discrete, with predefined fixed values such as a or b, 0 or 1, and is utilized for predicting categorical outcomes based on probability.', 'duration': 211.315, 'highlights': ['Logistic regression is used when the outcome of the dependent variable is categorical or discrete, with predefined fixed values such as A or B, 0 or 1. This highlights the specific scenario in which logistic regression is utilized, emphasizing the use of predefined fixed values for the dependent variable.', 'The chapter explains the concept of logistic regression, its purpose, and the categorization of regression into linear, logistic, and polynomial types. This highlights the main focus of the chapter, covering the explanation of logistic regression, its purpose, and the categorization of regression into different types.', 'Logistic regression is categorized under both classification and regression algorithms, as it involves classifying the output based on probability before deciding categorical outcomes. This highlights the dual categorization of logistic regression under both classification and regression algorithms, emphasizing its involvement in classifying outputs based on probability.']}], 'duration': 348.959, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk59438.jpg', 'highlights': ['The chapter covers the five fundamental questions in data science and their corresponding algorithms, providing a comprehensive overview of the topic.', 'Classification algorithms are used for questions involving categorization, such as distinguishing between objects like apple and pineapple or pen and pencil.', 'Anomaly detection algorithms are designed to identify pattern changes, providing a crucial tool for recognizing anomalies or irregularities in data.', 'Regression algorithms are utilized to address questions related to numerical values and predictions, such as temperature forecasts or predicting the occurrence of certain events.', 'Clustering algorithms are applied to questions concerning the organization and grouping of data, providing insights into patterns and relationships within the dataset.', 'Reinforcement learning algorithms enable decision-making capabilities in situations where clear decision-making criteria may not be available, offering a valuable tool for guiding actions in uncertain environments.', 'Logistic regression is used when the outcome of the dependent variable is categorical or discrete, with predefined fixed values such as A or B, 0 or 1.', 'The chapter explains the concept of logistic regression, its purpose, and the categorization of regression into different types.', 'Logistic regression is categorized under both classification and regression algorithms, as it involves classifying the output based on probability before deciding categorical outcomes.']}, {'end': 1098.832, 'segs': [{'end': 770.892, 'src': 'heatmap', 'start': 705.976, 'weight': 1, 'content': [{'end': 713.058, 'text': 'So if you want to make our value between 0 and infinity, what we can do is we can divide it by 1 minus y.', 'start': 705.976, 'duration': 7.082}, {'end': 717.82, 'text': 'If we do that, if y is 0, it will be 0 over 1 minus 0, which is 0.', 'start': 713.058, 'duration': 4.762}, {'end': 723.922, 'text': 'And if y is 1, it will be 0 over 1 over 1 minus 1, which is 1 by 0, which is infinity.', 'start': 717.82, 'duration': 6.102}, {'end': 728.183, 'text': "Right, so my y's range has now become between zero and infinity.", 'start': 724.602, 'duration': 3.581}, {'end': 737.166, 'text': "But we want our y's range between minus infinity to infinity and hence we do one more transformation and we apply the log function to it.", 'start': 728.723, 'duration': 8.443}, {'end': 742.147, 'text': 'So log of zero is minus of infinity and log of infinity is again infinity.', 'start': 737.726, 'duration': 4.421}, {'end': 745.446, 'text': 'Right?. So now, when?', 'start': 742.725, 'duration': 2.721}, {'end': 755.048, 'text': 'now this function, this particular element that is log of y over 1 minus y, has a range between minus infinity and infinity,', 'start': 745.446, 'duration': 9.602}, {'end': 763.19, 'text': 'and hence it can be compared now with this y, whose range is between minus infinity and infinity, and hence it becomes a linear equation.', 'start': 755.048, 'duration': 8.142}, {'end': 766.831, 'text': 'So this is the linear equation for this S curve.', 'start': 763.65, 'duration': 3.181}, {'end': 770.892, 'text': 'Alright?. So, guys, any doubt in whatever we did?', 'start': 767.291, 'duration': 3.601}], 'summary': 'By dividing value by 1-y, the range is 0 to infinity. apply log for -infinity to infinity, resulting in linear equation for the s curve.', 'duration': 25.446, 'max_score': 705.976, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk705976.jpg'}, {'end': 891.143, 'src': 'embed', 'start': 840.341, 'weight': 0, 'content': [{'end': 850.023, 'text': 'What happens in logistic regression is you calculate probabilities as to what is the probability of y being one, and based on those probabilities,', 'start': 840.341, 'duration': 9.682}, {'end': 851.944, 'text': 'you take a call what will be a threshold?', 'start': 850.023, 'duration': 1.921}, {'end': 856.407, 'text': 'And whenever your value is above that threshold, you convert it to be a 1..', 'start': 852.464, 'duration': 3.943}, {'end': 861.95, 'text': 'And whenever your value is below that threshold, your probability value is below that threshold, you calculate it to be a 0.', 'start': 856.407, 'duration': 5.543}, {'end': 865.273, 'text': 'Alright, so this is what logistic regression is.', 'start': 861.95, 'duration': 3.323}, {'end': 871.203, 'text': 'Alright, so categorical is when your values are fixed, they are discrete.', 'start': 866.138, 'duration': 5.065}, {'end': 880.873, 'text': 'Your values could be either A or B or C, right? Dependent is when your Y is dependent on X, right? So X value is independent.', 'start': 871.884, 'duration': 8.989}, {'end': 883.415, 'text': 'You can fit any value in the X.', 'start': 881.093, 'duration': 2.322}, {'end': 891.143, 'text': 'But your y value will be dependent on x and whatever input you give to x, y will change according to x.', 'start': 884.415, 'duration': 6.728}], 'summary': "Logistic regression calculates probabilities for y, using a threshold to convert values to 0 or 1. it's used for categorical and dependent variables.", 'duration': 50.802, 'max_score': 840.341, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk840341.jpg'}, {'end': 1023.33, 'src': 'embed', 'start': 994.503, 'weight': 3, 'content': [{'end': 998.684, 'text': 'So this is what happens in your logistic regression model.', 'start': 994.503, 'duration': 4.181}, {'end': 1002.365, 'text': 'Now how does it work? So let me give you an example.', 'start': 999.284, 'duration': 3.081}, {'end': 1005.185, 'text': 'We have understood the theory that this is the way it happens.', 'start': 1002.385, 'duration': 2.8}, {'end': 1007.586, 'text': "So let's see it in a real life use case.", 'start': 1005.225, 'duration': 2.361}, {'end': 1016.664, 'text': "So I have a list of people's IQ, right? So I'm a company and I want to recruit people, all right? So I came up with their IQs.", 'start': 1008.536, 'duration': 8.128}, {'end': 1023.33, 'text': 'I have their IQs in my hand and I want them to be selected automatically using a logistic regression model.', 'start': 1016.824, 'duration': 6.506}], 'summary': 'Logistic regression model selects people based on iq using real-life use case.', 'duration': 28.827, 'max_score': 994.503, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk994503.jpg'}], 'start': 409.238, 'title': 'Logistic regression in binary classification', 'summary': 'Discusses the limitation of linear regression in binary classification due to the misalignment with discrete output values, introduces logistic regression using the s-curve to represent the transition of y values and probability calculation, and explains logistic regression as a model for categorical dependent variables with a real-life case example of using iq to predict selection.', 'chapters': [{'end': 475.257, 'start': 409.238, 'title': 'Limitation of linear regression in binary classification', 'summary': 'Explains the limitation of using linear regression for binary classification by demonstrating how the best fit line of linear regression does not align with the discrete nature of the output values, which can only be 0 or 1.', 'duration': 66.019, 'highlights': ['Linear regression best fit line crosses 0 and 1, while output values can only be 0 or 1.', 'Explanation of using linear regression for continuous y values and the mismatch with discrete y values in binary classification.']}, {'end': 770.892, 'start': 475.837, 'title': 'Logistic regression & sigmoid curve', 'summary': "Explains the concept of logistic regression using the s-curve, highlighting the transition of y values and the probability calculation, and the transformation of the y's range to achieve a linear equation for representing the curve.", 'duration': 295.055, 'highlights': ['Logistic regression gives the probability of y being one, allowing to predict outcomes based on a threshold value, such as 0.5, where probabilities higher than the threshold are converted to one. Logistic regression model calculates the probability of winning, e.g., 0.8, and applies a threshold, such as 0.5, to predict the outcome as one if the probability exceeds the threshold.', "The S-curve is used to represent the transition of y values, where the range of y is transformed from 0 to 1 to -∞ to ∞ using the log function, allowing it to be compared with a linear equation. The transformation of the y's range from 0 to 1 to -∞ to ∞ using the log function enables the S-curve to be represented by a linear equation.", "The linear equation for the S-curve is achieved by transforming the range of y to -∞ to ∞ using the log function, enabling it to be compared with a linear equation. The transformation of y's range to -∞ to ∞ using the log function results in a linear equation representing the S-curve."]}, {'end': 1098.832, 'start': 773.075, 'title': 'Understanding logistic regression', 'summary': 'Explains logistic regression, a regression model used when the dependent variable is categorical, where probabilities are calculated to decide the threshold for categorizing values, with a real-life case example of using iq to predict selection.', 'duration': 325.757, 'highlights': ['Logistic regression is used when the dependent variable is categorical, and probabilities are calculated to decide the threshold for categorizing values. Logistic regression explained', 'A real-life example of using IQ to predict selection using a logistic regression model is provided, where the model calculates the probability of selection based on past records and compares it with a threshold. Real-life case example of using logistic regression', 'Explanation of how logistic regression works, including the calculation of probabilities and the comparison with a threshold to categorize values. Working mechanism of logistic regression', 'Discussion on the creation of the logistic regression model and the process of coming up with this kind of model. Creating a logistic regression model']}], 'duration': 689.594, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk409238.jpg', 'highlights': ['Logistic regression gives the probability of y being one, allowing to predict outcomes based on a threshold value, such as 0.5.', 'The S-curve is used to represent the transition of y values, where the range of y is transformed from 0 to 1 to -∞ to ∞ using the log function.', 'Logistic regression is used when the dependent variable is categorical, and probabilities are calculated to decide the threshold for categorizing values.', 'A real-life example of using IQ to predict selection using a logistic regression model is provided, where the model calculates the probability of selection based on past records and compares it with a threshold.']}, {'end': 1773.149, 'segs': [{'end': 1380.034, 'src': 'embed', 'start': 1341.235, 'weight': 1, 'content': [{'end': 1348.257, 'text': 'Now, the larger part of the data set will be used in training and the smaller part will be used in the model validation so that we can come up with an accuracy.', 'start': 1341.235, 'duration': 7.022}, {'end': 1356.519, 'text': 'So we will be dividing our data set and then this like I said this data set you will be used to create the model.', 'start': 1349.757, 'duration': 6.762}, {'end': 1363.12, 'text': 'So once your model is created this is what you get when you look for summary of the model.', 'start': 1357.359, 'duration': 5.761}, {'end': 1367.701, 'text': 'So when you type in summary model you will get all these values.', 'start': 1364.141, 'duration': 3.56}, {'end': 1369.622, 'text': 'Now these values are very important guys.', 'start': 1367.781, 'duration': 1.841}, {'end': 1373.793, 'text': 'So this is the value that you need to focus on as of now.', 'start': 1370.612, 'duration': 3.181}, {'end': 1376.994, 'text': 'So the first value is the intercept.', 'start': 1374.593, 'duration': 2.401}, {'end': 1380.034, 'text': 'So this is basically the constant value in your equation.', 'start': 1377.174, 'duration': 2.86}], 'summary': 'Training data: larger portion, model validation: smaller portion, focus on intercept value.', 'duration': 38.799, 'max_score': 1341.235, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk1341235.jpg'}, {'end': 1571.886, 'src': 'embed', 'start': 1544.655, 'weight': 0, 'content': [{'end': 1549.456, 'text': 'It will get the beta one, beta two values from the model, and it will predict the value for you.', 'start': 1544.655, 'duration': 4.801}, {'end': 1554.938, 'text': 'But you should understand what is happening in the background, and that is the reason we have explained you this expression.', 'start': 1549.856, 'duration': 5.082}, {'end': 1560.84, 'text': 'So this is the expression which is used, which is logit of y is used to calculate the probability of y.', 'start': 1555.438, 'duration': 5.402}, {'end': 1561.621, 'text': 'all right?', 'start': 1560.84, 'duration': 0.781}, {'end': 1566.784, 'text': 'Now, as you can see, these are the values that we got from our data set right.', 'start': 1562.441, 'duration': 4.343}, {'end': 1571.886, 'text': "Now these are the values that we'll be feeding to our logit y function alright.", 'start': 1567.204, 'duration': 4.682}], 'summary': 'Model predicts values using beta values and logit function.', 'duration': 27.231, 'max_score': 1544.655, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk1544655.jpg'}, {'end': 1758.542, 'src': 'embed', 'start': 1731.69, 'weight': 3, 'content': [{'end': 1736.436, 'text': "So now we'll be predicting our aim is to predict whether a patient is diabetic or not.", 'start': 1731.69, 'duration': 4.746}, {'end': 1736.936, 'text': 'All right.', 'start': 1736.636, 'duration': 0.3}, {'end': 1742.263, 'text': 'Now, how will we predict that we have a data set wherein we have values like These?', 'start': 1737.377, 'duration': 4.886}, {'end': 1746.729, 'text': 'so we have NPreg, which is the number of pregnancies that that patient has had.', 'start': 1742.263, 'duration': 4.466}, {'end': 1750.233, 'text': 'We have GLU, which is the plasma glucose concentration.', 'start': 1747.169, 'duration': 3.064}, {'end': 1756.381, 'text': 'We have the BP, we have the BP levels of that patient, the skin, that is the triceps skin fold thickness.', 'start': 1750.774, 'duration': 5.607}, {'end': 1758.542, 'text': 'This is a test which is done right?', 'start': 1756.861, 'duration': 1.681}], 'summary': 'Aiming to predict diabetes using patient data such as pregnancies, glucose, and blood pressure.', 'duration': 26.852, 'max_score': 1731.69, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk1731690.jpg'}], 'start': 1099.372, 'title': 'Predictive modeling and logistic regression', 'summary': "Introduces predictive modeling using r studio's 'empty cars' dataset to predict car engine type based on displacement and weight. it also covers training logistic regression models, model interpretation, validation, and application on predicting diabetes.", 'chapters': [{'end': 1293.736, 'start': 1099.372, 'title': 'Predicting car engine type', 'summary': "Introduces a predictive modeling exercise using r studio's inbuilt dataset 'empty cars' to predict car engine type (vs or straight) based on displacement and weight, by dividing the dataset into training and testing sets and selecting specific variables.", 'duration': 194.364, 'highlights': ["The model aims to predict car engine type (Vs or straight) based on displacement and weight, by selecting specific variables DISP and WT, from the 'empty cars' dataset in R studio. The exercise focuses on predicting car engine type using the 'empty cars' dataset in R studio and emphasizes the selection of variables DISP and WT for the model.", 'The dataset is divided into training and testing sets to train the model for predicting values based on past records and results. The process involves dividing the dataset into training and testing sets to train the model for predicting values based on past records and results.', 'The values of VS and AM are discrete or categorical, either 0 or 1, and will be used to predict the type of engine in the car. The values of VS and AM are discrete or categorical, either 0 or 1, and will be used to predict the type of engine in the car.']}, {'end': 1773.149, 'start': 1294.236, 'title': 'Logistic regression and model validation', 'summary': 'Explains the process of training a logistic regression model, interpreting the model summary, and validating the model using a dataset. it also demonstrates the application of logistic regression on predicting diabetes based on patient data.', 'duration': 478.913, 'highlights': ['The model is trained using a dataset and then tested using a separate testing dataset to come up with an accuracy, by dividing the data set between training and model validation. The process involves training the model using a larger part of the dataset, testing it with a smaller part for model validation, and determining the accuracy of the model.', "The model summary includes important values such as the intercept and coefficients for independent variables, which are calculated using the MLE method, and these values are crucial for the model. The model summary provides essential values including the intercept and coefficients for independent variables, calculated using the MLE method, which are crucial for the model's performance.", 'The logistic regression model uses the logit of y to calculate the probability of y being 1, and then applies a threshold of 0.5 to determine the success or failure of the prediction. The logistic regression model uses the logit of y to calculate the probability of y being 1, and applies a threshold of 0.5 to determine the outcome, where a probability greater than 0.5 is considered a success and vice versa.', "The process involves manually applying the logistic regression formula to calculate the predicted value, and then comparing it with the testing dataset to validate the model's accuracy. The manual application of the logistic regression formula is used to calculate the predicted value, which is then compared with the testing dataset to validate the accuracy of the model.", 'The chapter also introduces the application of logistic regression in predicting diabetes based on patient data, including features such as number of pregnancies, plasma glucose concentration, blood pressure, skin fold thickness, body mass index, pedigree per function, and age. The application of logistic regression is demonstrated in predicting diabetes based on patient data, including features such as the number of pregnancies, plasma glucose concentration, blood pressure, skin fold thickness, body mass index, pedigree per function, and age.']}], 'duration': 673.777, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk1099372.jpg', 'highlights': ['The logistic regression model uses the logit of y to calculate the probability of y being 1, and applies a threshold of 0.5 to determine the outcome, where a probability greater than 0.5 is considered a success and vice versa.', "The model summary provides essential values including the intercept and coefficients for independent variables, calculated using the MLE method, which are crucial for the model's performance.", 'The process involves dividing the dataset into training and testing sets to train the model for predicting values based on past records and results.', 'The application of logistic regression is demonstrated in predicting diabetes based on patient data, including features such as the number of pregnancies, plasma glucose concentration, blood pressure, skin fold thickness, body mass index, pedigree per function, and age.']}, {'end': 2152.01, 'segs': [{'end': 1807.55, 'src': 'embed', 'start': 1773.189, 'weight': 1, 'content': [{'end': 1774.549, 'text': 'So he is in the diabetic type.', 'start': 1773.189, 'duration': 1.36}, {'end': 1778.151, 'text': 'So if the value is 1, it means our patient is diabetic.', 'start': 1775.13, 'duration': 3.021}, {'end': 1783.603, 'text': 'If the value is 0, that means our patient is not diabetic.', 'start': 1778.771, 'duration': 4.832}, {'end': 1783.823, 'text': 'all right?', 'start': 1783.603, 'duration': 0.22}, {'end': 1785.564, 'text': 'So we have to predict.', 'start': 1783.843, 'duration': 1.721}, {'end': 1792.666, 'text': 'by entering these values, we have to create a model which will predict whether our patient will be diabetic or not.', 'start': 1785.564, 'duration': 7.102}, {'end': 1792.946, 'text': 'all right?', 'start': 1792.666, 'duration': 0.28}, {'end': 1795.287, 'text': "Having said that, let's move on.", 'start': 1793.446, 'duration': 1.841}, {'end': 1797.107, 'text': "So let's create this model now.", 'start': 1795.607, 'duration': 1.5}, {'end': 1800.448, 'text': "So in R, first we'll be passing this command.", 'start': 1798.027, 'duration': 2.421}, {'end': 1807.55, 'text': 'So first we would have to import our dataset, right? So let me quickly go to my R console.', 'start': 1801.268, 'duration': 6.282}], 'summary': 'Creating a model in r to predict diabetes in patients based on input values.', 'duration': 34.361, 'max_score': 1773.189, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk1773189.jpg'}, {'end': 1871.392, 'src': 'embed', 'start': 1846.575, 'weight': 0, 'content': [{'end': 1852.857, 'text': 'So for splitting our data set into training and testing we have to include this library which is CA tools.', 'start': 1846.575, 'duration': 6.282}, {'end': 1857.779, 'text': 'Once we do that we will be splitting our data set into training and testing.', 'start': 1853.577, 'duration': 4.202}, {'end': 1860.221, 'text': 'Alright, so that has been done.', 'start': 1858.499, 'duration': 1.722}, {'end': 1861.702, 'text': 'Let me explain you the commands.', 'start': 1860.281, 'duration': 1.421}, {'end': 1864.585, 'text': 'Alright, so first my data is split.', 'start': 1861.722, 'duration': 2.863}, {'end': 1869.47, 'text': "Alright, so this is the data that I've got from the CSE file in this variable.", 'start': 1864.965, 'duration': 4.505}, {'end': 1871.392, 'text': 'Alright, so this is that variable.', 'start': 1869.49, 'duration': 1.902}], 'summary': 'Data set split into training and testing using ca tools.', 'duration': 24.817, 'max_score': 1846.575, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk1846575.jpg'}, {'end': 1922.212, 'src': 'embed', 'start': 1892.699, 'weight': 2, 'content': [{'end': 1895.102, 'text': 'And this values they are picked actually randomly.', 'start': 1892.699, 'duration': 2.403}, {'end': 1896.164, 'text': "It's not sequential.", 'start': 1895.142, 'duration': 1.022}, {'end': 1901.41, 'text': 'Random values are picked and each value is assigned a value which is like true or false.', 'start': 1896.604, 'duration': 4.806}, {'end': 1901.891, 'text': 'All right.', 'start': 1901.611, 'duration': 0.28}, {'end': 1909.28, 'text': 'So 0.8 part of my data set will be assigned the true value and 0.2 part of my data set will be assigned a false value.', 'start': 1902.191, 'duration': 7.089}, {'end': 1912.323, 'text': "Now what that means is, you'll understand in the next line.", 'start': 1909.821, 'duration': 2.502}, {'end': 1915.626, 'text': "So once I've said split, the next line is training.", 'start': 1912.924, 'duration': 2.702}, {'end': 1917.008, 'text': 'For my training data set.', 'start': 1915.847, 'duration': 1.161}, {'end': 1922.212, 'text': "I'm saying the subset of data where the split value is true, right?", 'start': 1917.008, 'duration': 5.204}], 'summary': 'Random values assigned as true or false with 0.8 true and 0.2 false split for training data.', 'duration': 29.513, 'max_score': 1892.699, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk1892699.jpg'}, {'end': 2106.523, 'src': 'embed', 'start': 2054.994, 'weight': 3, 'content': [{'end': 2059.576, 'text': 'So you have a lot of independent variables here and hence a lot of coefficients, right?', 'start': 2054.994, 'duration': 4.582}, {'end': 2065.6, 'text': "So these are the coefficients and these will be used when you'll be predicting your value.", 'start': 2059.917, 'duration': 5.683}, {'end': 2067.821, 'text': "So you don't have to worry about these values.", 'start': 2065.699, 'duration': 2.122}, {'end': 2070.203, 'text': 'These values will be automatically taken.', 'start': 2068.161, 'duration': 2.042}, {'end': 2075.146, 'text': 'The next thing that you should be focusing on here is this.', 'start': 2070.763, 'duration': 4.383}, {'end': 2080.329, 'text': 'So this is the significance code that your R provides you with.', 'start': 2075.585, 'duration': 4.744}, {'end': 2085.272, 'text': 'So basically this tells you how much significant that particular independent variable is.', 'start': 2080.369, 'duration': 4.903}, {'end': 2088.594, 'text': 'So in our summary we have got these significant codes.', 'start': 2085.351, 'duration': 3.243}, {'end': 2094.496, 'text': 'So these significant codes specify how much significant your data is.', 'start': 2088.974, 'duration': 5.522}, {'end': 2095.757, 'text': 'all right?', 'start': 2094.496, 'duration': 1.261}, {'end': 2100.64, 'text': "So let's see what does this actually mean, all right?", 'start': 2096.498, 'duration': 4.142}, {'end': 2106.523, 'text': 'So three stars, or three asterisks, if they have been specified in front of your independent variable,', 'start': 2101.04, 'duration': 5.483}], 'summary': 'The significance code in r specifies how significant an independent variable is in the data.', 'duration': 51.529, 'max_score': 2054.994, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk2054994.jpg'}], 'start': 1773.189, 'title': 'Creating diabetic prediction model in r', 'summary': 'Introduces how to create a model in r to predict whether a patient is diabetic, covering data importing, splitting, and model creation. it also explains how to obtain and interpret the model summary and significance codes in r, indicating confidence levels with specific symbols.', 'chapters': [{'end': 2007.078, 'start': 1773.189, 'title': 'Creating diabetic prediction model in r', 'summary': 'Introduces how to create a model in r to predict whether a patient is diabetic based on given values, and covers data importing, splitting, and model creation using commands and libraries.', 'duration': 233.889, 'highlights': ['The chapter explains the process of splitting the dataset into training and testing in the ratio 8:2 using the CA tools library, which is important for model creation.', 'It details the command for creating a model in logistic regression using GLM, specifying the formula and data set, and defining the family of Y as binomial for prediction.', 'The initial explanation of the diabetic prediction model, including the values 1 and 0 indicating diabetic or non-diabetic patients, sets the context for the entire process.', 'It elaborates on the process of importing the dataset and displaying the data set in the R environment, providing a foundational understanding for further steps.', 'The chapter also emphasizes the random assignment of true and false values to the dataset, highlighting the key aspect of randomness in the splitting process.']}, {'end': 2152.01, 'start': 2007.878, 'title': 'Model summary and significance codes', 'summary': "Explains how to obtain and interpret the summary of a model in r and the significance codes provided, indicating the confidence level of each independent variable's contribution to the model, with three stars representing 99.9% confidence, two stars representing 99% confidence, one star representing 95% confidence, and a dot representing 90% confidence.", 'duration': 144.132, 'highlights': ['The summary of the model includes the coefficients for the independent variables, which will be used in predicting values.', 'The significance codes provided by R indicate the confidence level of each independent variable, with three stars representing 99.9% confidence, two stars representing 99% confidence, one star representing 95% confidence, and a dot representing 90% confidence.', 'The significance codes specify the level of confidence in the contribution of each independent variable to the model, with higher confidence levels indicating a more significant impact on the accuracy of the model.']}], 'duration': 378.821, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk1773189.jpg', 'highlights': ['The chapter explains the process of splitting the dataset into training and testing in the ratio 8:2 using the CA tools library, which is important for model creation.', 'The initial explanation of the diabetic prediction model, including the values 1 and 0 indicating diabetic or non-diabetic patients, sets the context for the entire process.', 'The chapter also emphasizes the random assignment of true and false values to the dataset, highlighting the key aspect of randomness in the splitting process.', 'The summary of the model includes the coefficients for the independent variables, which will be used in predicting values.', 'The significance codes provided by R indicate the confidence level of each independent variable, with three stars representing 99.9% confidence, two stars representing 99% confidence, one star representing 95% confidence, and a dot representing 90% confidence.', 'The significance codes specify the level of confidence in the contribution of each independent variable to the model, with higher confidence levels indicating a more significant impact on the accuracy of the model.']}, {'end': 2563.718, 'segs': [{'end': 2181.441, 'src': 'embed', 'start': 2152.67, 'weight': 1, 'content': [{'end': 2162.577, 'text': 'Then we have the beta values, so this particular value, that is the GLU, is significant, right, and our BMI is significant.', 'start': 2152.67, 'duration': 9.907}, {'end': 2169.118, 'text': 'Our PED is significant and the rest of the values it says are not significant.', 'start': 2163.596, 'duration': 5.522}, {'end': 2175.319, 'text': 'So basically what we are doing over here is basically we are optimizing our model.', 'start': 2169.138, 'duration': 6.181}, {'end': 2181.441, 'text': 'So now if this record is not significant, you cannot straight away remove this record.', 'start': 2175.799, 'duration': 5.642}], 'summary': 'Optimizing model with significant beta values for glu, bmi, and ped.', 'duration': 28.771, 'max_score': 2152.67, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk2152670.jpg'}, {'end': 2376.625, 'src': 'heatmap', 'start': 2196.228, 'weight': 0.785, 'content': [{'end': 2203.592, 'text': 'Alright, so what is null deviance? Null deviance is basically the deviance that you get from the actual value of your data set.', 'start': 2196.228, 'duration': 7.364}, {'end': 2208.655, 'text': "So if I'm saying I'm passing these many values and this is the outcome of this.", 'start': 2203.672, 'duration': 4.983}, {'end': 2215.159, 'text': 'So my particular model is 311 units deviant when it is null.', 'start': 2209.275, 'duration': 5.884}, {'end': 2223.304, 'text': "So what is the meaning of null? Null means when you're not using any of your independent variable, you're only using the intercept, this constant.", 'start': 2215.219, 'duration': 8.085}, {'end': 2231.827, 'text': "Or, if you go by the equation, when you're only using the beta naught and not the beta 1 x1 and the beta 2 x2 and the beta 3 x3,", 'start': 2223.864, 'duration': 7.963}, {'end': 2234.048, 'text': "how much is the value that you'll be getting right?", 'start': 2231.827, 'duration': 2.221}, {'end': 2238.068, 'text': 'How much your model is going to be deviant from the actual value?', 'start': 2234.168, 'duration': 3.9}, {'end': 2239.789, 'text': 'So it is 311 units.', 'start': 2238.088, 'duration': 1.701}, {'end': 2247.571, 'text': 'When we talk about the residual deviance, so your residual deviance is basically when you include your independent variables in your models.', 'start': 2240.569, 'duration': 7.002}, {'end': 2253.152, 'text': 'When you include your independent variables, this deviance is actually coming down to a smaller number.', 'start': 2247.611, 'duration': 5.541}, {'end': 2261.589, 'text': "Right? Which is obviously the fact because whenever you're using the independent variables you are making the accuracy of your model more correct.", 'start': 2253.82, 'duration': 7.769}, {'end': 2266.295, 'text': 'Right? So this value comes down at 229.35 from 311.15 which is correct.', 'start': 2262.01, 'duration': 4.285}, {'end': 2275.911, 'text': 'Now the third value is AIC, right? So this value should be as minimum as possible.', 'start': 2270.106, 'duration': 5.805}, {'end': 2283.156, 'text': 'So this is helpful, then, when you are actually removing the not necessary independent variables from this data set right?', 'start': 2276.411, 'duration': 6.745}, {'end': 2286.379, 'text': 'So now we will be optimizing our model.', 'start': 2283.657, 'duration': 2.722}, {'end': 2288.541, 'text': 'Now how will we optimize our model is like this.', 'start': 2286.439, 'duration': 2.102}, {'end': 2299.109, 'text': 'We know that this particular or the number of pregnancies is not a significant independent variable as in it is not contributing to our model.', 'start': 2289.341, 'duration': 9.768}, {'end': 2301.193, 'text': 'according to its calculations.', 'start': 2299.75, 'duration': 1.443}, {'end': 2305.56, 'text': 'R is telling us that even BP is not a significant variable.', 'start': 2302.114, 'duration': 3.446}, {'end': 2310.408, 'text': 'Skin, that is the skin for a test is also not a significant variable.', 'start': 2306.301, 'duration': 4.107}, {'end': 2314.46, 'text': 'And according to our age is also not a significant variable.', 'start': 2311.218, 'duration': 3.242}, {'end': 2317.522, 'text': 'Now how can we double check this is like this.', 'start': 2314.56, 'duration': 2.962}, {'end': 2325.027, 'text': "So we will basically remove one by one the independent variables and we'll check what are the difference in the values of this.", 'start': 2318.023, 'duration': 7.004}, {'end': 2329.83, 'text': 'So basically your residual deviance should not increase and your AIC should decrease.', 'start': 2325.127, 'duration': 4.703}, {'end': 2335.394, 'text': 'So if both of them is true then your variable removal is right.', 'start': 2329.871, 'duration': 5.523}, {'end': 2336.235, 'text': "So let's do that.", 'start': 2335.414, 'duration': 0.821}, {'end': 2340.938, 'text': "So let's call our model function and remove age from it.", 'start': 2336.635, 'duration': 4.303}, {'end': 2347.94, 'text': "So if we remove age and then we call the summary of the model, let's see what different values we get.", 'start': 2341.498, 'duration': 6.442}, {'end': 2349.661, 'text': 'All right.', 'start': 2348.861, 'duration': 0.8}, {'end': 2360.184, 'text': 'so my residual deviance value was 229.35 before and now it has increased to 231.57, which is not right, right?', 'start': 2349.661, 'duration': 10.523}, {'end': 2365.206, 'text': "Also, my AIC value had to be reduced, if I'm removing a variable right?", 'start': 2360.684, 'duration': 4.522}, {'end': 2372.104, 'text': 'But it was 245.35 here And it has actually increased to 245.57..', 'start': 2365.686, 'duration': 6.418}, {'end': 2376.625, 'text': 'That means age is a significant variable, hence it cannot be removed.', 'start': 2372.104, 'duration': 4.521}], 'summary': 'Null deviance is 311 units, residual deviance decreases to 229.35 with independent variables, aic should be minimized, optimizing model by removing non-significant variables.', 'duration': 180.397, 'max_score': 2196.228, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk2196228.jpg'}, {'end': 2347.94, 'src': 'embed', 'start': 2314.56, 'weight': 0, 'content': [{'end': 2317.522, 'text': 'Now how can we double check this is like this.', 'start': 2314.56, 'duration': 2.962}, {'end': 2325.027, 'text': "So we will basically remove one by one the independent variables and we'll check what are the difference in the values of this.", 'start': 2318.023, 'duration': 7.004}, {'end': 2329.83, 'text': 'So basically your residual deviance should not increase and your AIC should decrease.', 'start': 2325.127, 'duration': 4.703}, {'end': 2335.394, 'text': 'So if both of them is true then your variable removal is right.', 'start': 2329.871, 'duration': 5.523}, {'end': 2336.235, 'text': "So let's do that.", 'start': 2335.414, 'duration': 0.821}, {'end': 2340.938, 'text': "So let's call our model function and remove age from it.", 'start': 2336.635, 'duration': 4.303}, {'end': 2347.94, 'text': "So if we remove age and then we call the summary of the model, let's see what different values we get.", 'start': 2341.498, 'duration': 6.442}], 'summary': 'Removing independent variables to check impact on residual deviance and aic values.', 'duration': 33.38, 'max_score': 2314.56, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk2314560.jpg'}, {'end': 2520.172, 'src': 'embed', 'start': 2487.877, 'weight': 2, 'content': [{'end': 2489.398, 'text': "So we'll be removing skin from model now.", 'start': 2487.877, 'duration': 1.521}, {'end': 2491.39, 'text': "Let's get the summary.", 'start': 2490.509, 'duration': 0.881}, {'end': 2498.033, 'text': 'Okay, so before my value of AIC was 245 point something.', 'start': 2492.13, 'duration': 5.903}, {'end': 2499.414, 'text': 'So it has reduced, awesome.', 'start': 2498.053, 'duration': 1.361}, {'end': 2504.997, 'text': "And my residual deviance was 229.35 and now I'm getting 229.61.", 'start': 2500.195, 'duration': 4.802}, {'end': 2509.72, 'text': 'Not a significant change and my AIC value has also reduced.', 'start': 2504.997, 'duration': 4.723}, {'end': 2516.324, 'text': 'So this can be considered, right? So we can remove the skin parameter or the skin variable from here.', 'start': 2510.36, 'duration': 5.964}, {'end': 2520.172, 'text': 'and hence get a value which is like this.', 'start': 2517.108, 'duration': 3.064}], 'summary': 'Aic reduced to 245 from 229.35, residual deviance increased slightly to 229.61, indicating skin variable removal is acceptable.', 'duration': 32.295, 'max_score': 2487.877, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk2487877.jpg'}], 'start': 2152.67, 'title': 'Model optimization in regression', 'summary': 'Discusses the significance of beta values including glu, bmi, and ped in optimizing the model, as well as the process of iteratively removing insignificant independent variables such as age, bp, and npreg, resulting in the removal of the skin variable.', 'chapters': [{'end': 2261.589, 'start': 2152.67, 'title': 'Model optimization and deviance in regression', 'summary': 'Discusses the significance of beta values, including glu, bmi, and ped, in optimizing the model, as well as the meaning and impact of null deviance and residual deviance on model accuracy.', 'duration': 108.919, 'highlights': ['The significance of beta values, including GLU, BMI, and PED, in optimizing the model by including independent variables for accuracy improvement.', 'Explanations of null deviance, indicating the deviance from the actual dataset values when using only the intercept, and residual deviance, which decreases when including independent variables in the model for improved accuracy.']}, {'end': 2563.718, 'start': 2262.01, 'title': 'Model optimization process', 'summary': 'Discusses the process of optimizing a model by iteratively removing insignificant independent variables, such as age, bp, and npreg, and checking for changes in residual deviance and aic values to ensure the model is optimized, resulting in the removal of the skin variable.', 'duration': 301.708, 'highlights': ['The skin variable is removed to optimize the model as it leads to a reduction in AIC value and insignificant change in residual deviance. After iteratively removing insignificant independent variables, the skin variable is found to be insignificant and is removed, resulting in a reduction in AIC value and an insignificant change in residual deviance.', 'The process involves iteratively removing insignificant independent variables such as age, BP, and NPreg, and checking the changes in residual deviance and AIC values to determine their significance in the model. The process involves iteratively removing insignificant independent variables such as age, BP, and NPreg, and checking the changes in residual deviance and AIC values to determine their significance in the model.', 'The model optimization process aims to ensure that the removal of independent variables results in a decrease in AIC value and no significant increase in residual deviance to optimize the model. The model optimization process aims to ensure that the removal of independent variables results in a decrease in AIC value and no significant increase in residual deviance to optimize the model.']}], 'duration': 411.048, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk2152670.jpg', 'highlights': ['The process involves iteratively removing insignificant independent variables such as age, BP, and NPreg, and checking the changes in residual deviance and AIC values to determine their significance in the model.', 'The significance of beta values, including GLU, BMI, and PED, in optimizing the model by including independent variables for accuracy improvement.', 'The skin variable is removed to optimize the model as it leads to a reduction in AIC value and insignificant change in residual deviance.']}, {'end': 3045.178, 'segs': [{'end': 2624.559, 'src': 'embed', 'start': 2594.827, 'weight': 1, 'content': [{'end': 2603.534, 'text': 'Alright so these values are all probabilities as you can see 0.0451, 0.628, 0.200, 0.36 and so on.', 'start': 2594.827, 'duration': 8.707}, {'end': 2611.541, 'text': 'So this is the testing data set that has been predicted and these probabilities have now been attached over here right.', 'start': 2604.115, 'duration': 7.426}, {'end': 2619.027, 'text': 'So the patient number two has a probability of 0.0451 of being diabetic alright.', 'start': 2612.021, 'duration': 7.006}, {'end': 2624.559, 'text': "So if we were to check this, let's quickly check this for our patient number two.", 'start': 2619.477, 'duration': 5.082}], 'summary': 'Testing data set shows patient 2 has 0.0451 probability of being diabetic.', 'duration': 29.732, 'max_score': 2594.827, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk2594827.jpg'}, {'end': 2677.173, 'src': 'embed', 'start': 2649.299, 'weight': 3, 'content': [{'end': 2654.103, 'text': 'And my model also says that he has a 0.04% chance of having diabetes.', 'start': 2649.299, 'duration': 4.804}, {'end': 2659.547, 'text': "All right, so far so good that my model has been corrected, right? Let's check one more value.", 'start': 2654.743, 'duration': 4.804}, {'end': 2667.913, 'text': 'So for patient number six, my probability is 0.628, all right? So that is greater than 0.5.', 'start': 2660.127, 'duration': 7.786}, {'end': 2677.173, 'text': 'That means he should be diabetic, right? So if we check that, So yes, my patient is diabetic, so my model is correcting right.', 'start': 2667.913, 'duration': 9.26}], 'summary': 'Model predicts 0.04% chance of diabetes; corrects diagnosis for patient 6.', 'duration': 27.874, 'max_score': 2649.299, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk2649299.jpg'}, {'end': 2900.905, 'src': 'embed', 'start': 2850.27, 'weight': 0, 'content': [{'end': 2855.412, 'text': 'So in my model, the patient was diabetic but my model predicted that he is not diabetic.', 'start': 2850.27, 'duration': 5.142}, {'end': 2858.734, 'text': 'This has occurred 9 times in my model.', 'start': 2855.913, 'duration': 2.821}, {'end': 2870.161, 'text': 'And for the data wherein my patient was actually diabetic and my model also predicted that he is diabetic has occurred 15 times.', 'start': 2860.774, 'duration': 9.387}, {'end': 2874.104, 'text': 'So this is how you can read a confusion matrix.', 'start': 2870.801, 'duration': 3.303}, {'end': 2876.666, 'text': 'Now, if you were to find the accuracy in this case.', 'start': 2874.144, 'duration': 2.522}, {'end': 2881.83, 'text': 'So if you were to ask me the formula, the formula is basically right diagonal.', 'start': 2877.486, 'duration': 4.344}, {'end': 2883.231, 'text': 'this is the right diagonal right?', 'start': 2881.83, 'duration': 1.401}, {'end': 2887.875, 'text': 'So 47 plus 15 divided by every record in the confusion matrix.', 'start': 2883.351, 'duration': 4.524}, {'end': 2890.056, 'text': 'Now why is this? Let me explain you that.', 'start': 2888.395, 'duration': 1.661}, {'end': 2900.905, 'text': 'So when my actual value was zero and my predicted value was also false, 47 is the number that I predicted correctly, all right? So that is 47.', 'start': 2890.717, 'duration': 10.188}], 'summary': 'Model accuracy is 47+15/total records, with 15 correct predictions of diabetes.', 'duration': 50.635, 'max_score': 2850.27, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk2850270.jpg'}, {'end': 3028.525, 'src': 'embed', 'start': 3005.003, 'weight': 4, 'content': [{'end': 3013.031, 'text': 'Similarly, my actual value was 1 and my model predicted that he is not diabetic, which is very dangerous.', 'start': 3005.003, 'duration': 8.028}, {'end': 3020.558, 'text': "If you are going through a disease and you go to the doctor and the doctor says you're fine, you've actually been given a wrong consultation,", 'start': 3013.371, 'duration': 7.187}, {'end': 3024.002, 'text': 'which could be harmful, or it could cost you your life as well.', 'start': 3020.558, 'duration': 3.444}, {'end': 3026.844, 'text': 'So this is a very sensitive number.', 'start': 3024.642, 'duration': 2.202}, {'end': 3028.525, 'text': 'This should be the minimum right?', 'start': 3026.884, 'duration': 1.641}], 'summary': 'Model predicted 1 as not diabetic, risking wrong consultation and harm.', 'duration': 23.522, 'max_score': 3005.003, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk3005003.jpg'}], 'start': 2564.779, 'title': 'Predicting diabetes probabilities and model accuracy', 'summary': 'Demonstrates predicting diabetes probabilities from a testing data set with patient-specific examples. it also explains how to check the accuracy of a model by creating a confusion matrix and calculating the accuracy, which is found to be 73% using the right diagonal values of the matrix.', 'chapters': [{'end': 2677.173, 'start': 2564.779, 'title': 'Predicting diabetes probabilities', 'summary': 'Demonstrates predicting diabetes probabilities from a testing data set, with patient-specific examples and model accuracy checks.', 'duration': 112.394, 'highlights': ['The testing data set predicts probabilities for diabetes, with specific examples such as patient number two having a 0.0451 probability of being diabetic and patient number six having a 0.628 probability of being diabetic.', "The model's accuracy is confirmed by comparing the predicted probabilities with the actual diabetes status of the patients, showing that the model's predictions align with the real values.", 'The chapter emphasizes the significance of model accuracy by showcasing patient-specific probabilities and actual diabetes status, ensuring correct predictions with a 0.04% chance of having diabetes and a probability greater than 0.5 indicating a diabetic patient.']}, {'end': 3045.178, 'start': 2677.193, 'title': 'Model accuracy and confusion matrix', 'summary': 'Explains how to check the accuracy of a model by creating a confusion matrix and calculating the accuracy, which is found to be 73%, using the right diagonal values of the matrix.', 'duration': 367.985, 'highlights': ['The accuracy of the model is calculated using the right diagonal values of the confusion matrix, yielding an accuracy of 73%. The accuracy of the model is calculated by adding the correct instances (47 + 15) and dividing by the total instances (47 + 13 + 9 + 15), resulting in an accuracy of 73%.', 'Explains the importance of minimizing the number of instances where the model incorrectly predicts a medical condition, emphasizing the sensitivity of such errors. Emphasizes the sensitivity of minimizing instances where the model incorrectly predicts a medical condition, highlighting the potential harm or life-threatening consequences, such as a doctor incorrectly diagnosing a patient as not having diabetes when they actually do.']}], 'duration': 480.399, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk2564779.jpg', 'highlights': ["The model's accuracy is confirmed by comparing the predicted probabilities with the actual diabetes status of the patients, showing that the model's predictions align with the real values.", 'The testing data set predicts probabilities for diabetes, with specific examples such as patient number six having a 0.628 probability of being diabetic.', 'The accuracy of the model is calculated using the right diagonal values of the confusion matrix, yielding an accuracy of 73%.', 'The chapter emphasizes the significance of model accuracy by showcasing patient-specific probabilities and actual diabetes status, ensuring correct predictions with a 0.04% chance of having diabetes and a probability greater than 0.5 indicating a diabetic patient.', 'Explains the importance of minimizing the number of instances where the model incorrectly predicts a medical condition, emphasizing the sensitivity of such errors.']}, {'end': 4145.532, 'segs': [{'end': 3147.363, 'src': 'embed', 'start': 3074.246, 'weight': 0, 'content': [{'end': 3079.891, 'text': 'Alright, so my accuracy now comes out to be 84% which is a very good number guys.', 'start': 3074.246, 'duration': 5.645}, {'end': 3083.595, 'text': 'Alright, so my accuracy is 84%.', 'start': 3080.472, 'duration': 3.123}, {'end': 3089.08, 'text': 'So we have optimized our model correctly and we have got the accuracy at 84.3.', 'start': 3083.595, 'duration': 5.485}, {'end': 3095.819, 'text': 'Now we have assumed that my threshold is to be 0.5.', 'start': 3089.08, 'duration': 6.739}, {'end': 3098.741, 'text': 'Now, how can we be so sure about the threshold right?', 'start': 3095.819, 'duration': 2.922}, {'end': 3102.404, 'text': 'What if I increase my threshold and my accuracy actually increases?', 'start': 3098.862, 'duration': 3.542}, {'end': 3105.827, 'text': 'And also, this number has to be reduced right?', 'start': 3102.945, 'duration': 2.882}, {'end': 3107.949, 'text': 'This number should be the minimum.', 'start': 3106.388, 'duration': 1.561}, {'end': 3113.614, 'text': 'What if this number can further go down? Alright? So for that we need to have the correct threshold.', 'start': 3108.009, 'duration': 5.605}, {'end': 3117.897, 'text': 'Now. one way of doing this is by actually doing the hidden trial method,', 'start': 3113.674, 'duration': 4.223}, {'end': 3122.161, 'text': 'by trying each and every threshold and seeing what are the effects that we get in a model.', 'start': 3117.897, 'duration': 4.264}, {'end': 3127.064, 'text': 'or what are the effects on the accuracy of the model or what is the effect on the confusion matrix.', 'start': 3122.661, 'duration': 4.403}, {'end': 3132.969, 'text': "But is there any other way through which we can find the threshold? Let's think about that.", 'start': 3127.765, 'duration': 5.204}, {'end': 3135.07, 'text': "Alright, so don't think too much.", 'start': 3133.609, 'duration': 1.461}, {'end': 3142.956, 'text': 'R actually has a method called the ROC curve which is used to calculate the threshold in your model.', 'start': 3135.711, 'duration': 7.245}, {'end': 3147.363, 'text': "Alright So let's see how that thing is done.", 'start': 3143.497, 'duration': 3.866}], 'summary': 'Model accuracy optimized to 84.3% through threshold adjustment and roc curve analysis.', 'duration': 73.117, 'max_score': 3074.246, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk3074246.jpg'}, {'end': 3197.771, 'src': 'heatmap', 'start': 3154.647, 'weight': 0.734, 'content': [{'end': 3161.992, 'text': "because you're basically calculating the threshold from the training data set so that they can be applied to whatever value will be passing to your model.", 'start': 3154.647, 'duration': 7.345}, {'end': 3165.686, 'text': 'Alright, so your threshold will be collected from your testing dataset.', 'start': 3162.625, 'duration': 3.061}, {'end': 3166.946, 'text': 'So let us do that.', 'start': 3166.186, 'duration': 0.76}, {'end': 3171.987, 'text': 'So our RES should have the predicted values from our testing dataset.', 'start': 3167.086, 'duration': 4.901}, {'end': 3175.667, 'text': 'So let us change our RES.', 'start': 3172.007, 'duration': 3.66}, {'end': 3188.229, 'text': 'Alright, so this is our RES guys.', 'start': 3186.549, 'duration': 1.68}, {'end': 3191.81, 'text': 'So let us change this to training dataset.', 'start': 3189.049, 'duration': 2.761}, {'end': 3197.771, 'text': "All right, let's run this command.", 'start': 3195.188, 'duration': 2.583}], 'summary': 'Calculating threshold from training data to be applied to testing dataset.', 'duration': 43.124, 'max_score': 3154.647, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk3154647.jpg'}, {'end': 3369.869, 'src': 'heatmap', 'start': 3319.38, 'weight': 0.739, 'content': [{'end': 3323.462, 'text': 'And then I want the cutoffs to be printed in the graph as well.', 'start': 3319.38, 'duration': 4.082}, {'end': 3332.145, 'text': 'So this basically means that whatever cutoffs experience a change will be printed so that it becomes easier for me to choose the threshold.', 'start': 3323.522, 'duration': 8.623}, {'end': 3336.528, 'text': 'Right, so once you execute this command, this is how your curve will look.', 'start': 3332.805, 'duration': 3.723}, {'end': 3338.67, 'text': 'This is what is a graph that you will be getting.', 'start': 3336.608, 'duration': 2.062}, {'end': 3340.191, 'text': "So let's pass this command.", 'start': 3338.71, 'duration': 1.481}, {'end': 3342.913, 'text': 'Let us plot the graph for ROCR.', 'start': 3340.511, 'duration': 2.402}, {'end': 3345.715, 'text': 'Alright, so this is the graph that you get.', 'start': 3343.854, 'duration': 1.861}, {'end': 3350.999, 'text': 'So as you can see, now how will you interpret this graph is something like this.', 'start': 3346.556, 'duration': 4.443}, {'end': 3355.042, 'text': 'This x-axis is basically the false positive rate.', 'start': 3352.02, 'duration': 3.022}, {'end': 3361.007, 'text': 'So this should be the minimum and this is the true positive rate and this should be the maximum.', 'start': 3355.522, 'duration': 5.485}, {'end': 3369.869, 'text': 'Alright so if you go by this graph as you can see between 0.3 and 0.2 there is a lot of gap for the false positive rate.', 'start': 3361.627, 'duration': 8.242}], 'summary': 'Printing cutoff changes on graph eases threshold selection.', 'duration': 50.489, 'max_score': 3319.38, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk3319380.jpg'}, {'end': 3878.506, 'src': 'embed', 'start': 3851.465, 'weight': 1, 'content': [{'end': 3858.291, 'text': 'So if this is orange and, as you can see, this is yellow, so this has more probability of being malaria prone, right?', 'start': 3851.465, 'duration': 6.826}, {'end': 3865.938, 'text': 'So our help could first go to this area and then maybe this area, because this area might need more help from us, right?', 'start': 3858.571, 'duration': 7.367}, {'end': 3868.36, 'text': 'So this is how logistic regression was used.', 'start': 3866.178, 'duration': 2.182}, {'end': 3873.044, 'text': 'We fed the geographic information systems data and we came up with a model.', 'start': 3868.8, 'duration': 4.244}, {'end': 3878.506, 'text': 'And then that model was used to predict the other areas of Africa wherein malaria could be there.', 'start': 3873.604, 'duration': 4.902}], 'summary': 'Logistic regression model uses gis data to predict malaria-prone areas in africa.', 'duration': 27.041, 'max_score': 3851.465, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk3851465.jpg'}, {'end': 3919.067, 'src': 'embed', 'start': 3895.412, 'weight': 4, 'content': [{'end': 3902.215, 'text': 'So when you have to predict whether your customer will buy this product or not, So that can be done using logistic regression.', 'start': 3895.412, 'duration': 6.803}, {'end': 3908.64, 'text': 'So logistic analysis is used by marketers to assess the scope of customers acceptance of a product.', 'start': 3902.255, 'duration': 6.385}, {'end': 3910.461, 'text': 'Like in our company.', 'start': 3909.4, 'duration': 1.061}, {'end': 3919.067, 'text': 'if we come up with a product, say we come up with a shaving gel and we see the past market trends that what product has been more successful,', 'start': 3910.461, 'duration': 8.606}], 'summary': 'Logistic regression predicts customer product acceptance based on past market trends.', 'duration': 23.655, 'max_score': 3895.412, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk3895412.jpg'}], 'start': 3045.218, 'title': 'Threshold optimization and logistic regression applications', 'summary': 'Covers the calculation of accuracy for a model, achieving 84% accuracy, using the roc curve to find the threshold, and discusses threshold selection resulting in an accuracy increase from 84.33% to 86.7%. additionally, it explores logistic regression applications in predicting malaria-prone areas and customer behavior in marketing research firms.', 'chapters': [{'end': 3345.715, 'start': 3045.218, 'title': 'Calculating threshold using roc curve', 'summary': 'Discusses the calculation of accuracy for a model, optimizing the model to achieve an 84% accuracy, and using the roc curve to find the threshold for the model, highlighting the importance of threshold optimization.', 'duration': 300.497, 'highlights': ['The accuracy of the model is calculated to be 84%, indicating successful model optimization.', 'The importance of finding the correct threshold for the model is emphasized to minimize errors and improve accuracy.', 'The ROC curve method is introduced as a means to calculate the threshold for the model using predicted values from the training dataset and testing dataset.']}, {'end': 3769.021, 'start': 3346.556, 'title': 'Threshold selection for model accuracy', 'summary': "Discusses the process of selecting the threshold value for a model, showing how adjusting the threshold from 0.5 to 0.3 resulted in an increase in accuracy from 84.33% to 86.7% and a decrease in the number of true negatives from 12 to 6, significantly improving the model's performance.", 'duration': 422.465, 'highlights': ['Adjusting the threshold from 0.5 to 0.3 increased model accuracy from 84.33% to 86.7%. The change in threshold value led to a quantifiable increase in model accuracy, highlighting the importance of threshold selection.', "The number of true negatives decreased from 12 to 6 after adjusting the threshold to 0.3. The adjustment in threshold value resulted in a significant decrease in the number of true negatives, indicating an improvement in the model's performance.", 'The process involved training the model using a training dataset and testing it with a testing dataset. This highlights the standard process of model training and testing, providing context for the subsequent threshold selection and evaluation.']}, {'end': 4145.532, 'start': 3769.702, 'title': 'Logistic regression applications', 'summary': 'Explains the application of logistic regression in predicting malaria-prone areas in africa using topography and geographic data and its use in marketing research firms to predict customer behavior and target ads.', 'duration': 375.83, 'highlights': ['Application in Predicting Malaria-Prone Areas Logistic regression was used to predict malaria-prone areas in Africa by analyzing topography and geographic data, enabling the identification of areas requiring more help based on the probabilities of malaria occurrence.', 'Application in Marketing Research Firms Logistic regression is utilized by marketing research firms to predict customer behavior and assess the acceptance of products, enabling companies to create successful products and target ads based on customer data.']}], 'duration': 1100.314, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Z5WKQr4H4Xk/pics/Z5WKQr4H4Xk3045218.jpg', 'highlights': ['Threshold adjustment from 0.5 to 0.3 increased model accuracy from 84.33% to 86.7%.', 'Logistic regression predicts malaria-prone areas in Africa based on topography and geographic data.', 'ROC curve method is introduced to calculate the threshold for the model using predicted values from the training and testing datasets.', 'The importance of finding the correct threshold for the model is emphasized to minimize errors and improve accuracy.', 'Logistic regression is utilized by marketing research firms to predict customer behavior and assess product acceptance.']}], 'highlights': ['The agenda for the session will cover five main questions in data science and deciding which algorithm to use based on these questions.', 'The chapter covers the five fundamental questions in data science and their corresponding algorithms, providing a comprehensive overview of the topic.', 'Classification algorithms are used for questions involving categorization, such as distinguishing between objects like apple and pineapple or pen and pencil.', 'Anomaly detection algorithms are designed to identify pattern changes, providing a crucial tool for recognizing anomalies or irregularities in data.', 'Regression algorithms are utilized to address questions related to numerical values and predictions, such as temperature forecasts or predicting the occurrence of certain events.', 'Clustering algorithms are applied to questions concerning the organization and grouping of data, providing insights into patterns and relationships within the dataset.', 'Reinforcement learning algorithms enable decision-making capabilities in situations where clear decision-making criteria may not be available, offering a valuable tool for guiding actions in uncertain environments.', 'Logistic regression is used when the outcome of the dependent variable is categorical or discrete, with predefined fixed values such as A or B, 0 or 1.', 'Logistic regression gives the probability of y being one, allowing to predict outcomes based on a threshold value, such as 0.5.', 'The S-curve is used to represent the transition of y values, where the range of y is transformed from 0 to 1 to -∞ to ∞ using the log function.', 'The logistic regression model uses the logit of y to calculate the probability of y being 1, and applies a threshold of 0.5 to determine the outcome, where a probability greater than 0.5 is considered a success and vice versa.', "The model summary provides essential values including the intercept and coefficients for independent variables, calculated using the MLE method, which are crucial for the model's performance.", 'The process involves dividing the dataset into training and testing sets to train the model for predicting values based on past records and results.', 'The chapter explains the process of splitting the dataset into training and testing in the ratio 8:2 using the CA tools library, which is important for model creation.', 'The initial explanation of the diabetic prediction model, including the values 1 and 0 indicating diabetic or non-diabetic patients, sets the context for the entire process.', 'The chapter also emphasizes the random assignment of true and false values to the dataset, highlighting the key aspect of randomness in the splitting process.', 'The process involves iteratively removing insignificant independent variables such as age, BP, and NPreg, and checking the changes in residual deviance and AIC values to determine their significance in the model.', 'The significance of beta values, including GLU, BMI, and PED, in optimizing the model by including independent variables for accuracy improvement.', 'The skin variable is removed to optimize the model as it leads to a reduction in AIC value and insignificant change in residual deviance.', "The model's accuracy is confirmed by comparing the predicted probabilities with the actual diabetes status of the patients, showing that the model's predictions align with the real values.", 'The testing data set predicts probabilities for diabetes, with specific examples such as patient number six having a 0.628 probability of being diabetic.', 'The accuracy of the model is calculated using the right diagonal values of the confusion matrix, yielding an accuracy of 73%.', 'Threshold adjustment from 0.5 to 0.3 increased model accuracy from 84.33% to 86.7%.', 'Logistic regression predicts malaria-prone areas in Africa based on topography and geographic data.', 'ROC curve method is introduced to calculate the threshold for the model using predicted values from the training and testing datasets.', 'The importance of finding the correct threshold for the model is emphasized to minimize errors and improve accuracy.']}