title
Decision Tree Algorithm | Decision Tree in Python | Machine Learning Algorithms | Edureka

description
πŸ”₯ Machine Learning with Python (Use Code "π˜πŽπ”π“π”ππ„πŸπŸŽ") : https://www.edureka.co/machine-learning-certification-training This Edureka video on Decision Tree Algorithm in Python will take you through the fundamentals of decision tree machine learning algorithm concepts and its demo in Python. Below are the topics covered in this tutorial: 1. What is Classification? 2. Types of Classification 3. Classification Use Case 4. What is Decision Tree? 5. Decision Tree Terminology 6. Visualizing a Decision Tree 7 Writing a Decision Tree Classifier fro Scratch in Python using CART Algorithm Subscribe to our channel to get video updates. Hit the subscribe button above. Check out our Python Machine Learning Playlist: https://goo.gl/UxjTxm PG in Artificial Intelligence and Machine Learning with NIT Warangal : https://www.edureka.co/post-graduate/machine-learning-and-ai Post Graduate Certification in Data Science with IIT Guwahati - https://www.edureka.co/post-graduate/data-science-program (450+ Hrs || 9 Months || 20+ Projects & 100+ Case studies) #decisiontree #decisiontreepython #machinelearningalgorithms - - - - - - - - - - - - - - - - - About the Course Edureka’s Machine Learning Course using Python is designed to make you grab the concepts of Machine Learning. The Machine Learning training will provide deep understanding of Machine Learning and its mechanism. As a Data Scientist, you will be learning the importance of Machine Learning and its implementation in python programming language. Furthermore, you will be taught Reinforcement Learning which in turn is an important aspect of Artificial Intelligence. You will be able to automate real life scenarios using Machine Learning Algorithms. Towards the end of the course, we will be discussing various practical use cases of Machine Learning in python programming language to enhance your learning experience. After completing this Machine Learning Certification Training using Python, you should be able to: Gain insight into the 'Roles' played by a Machine Learning Engineer Automate data analysis using python Describe Machine Learning Work with real-time data Learn tools and techniques for predictive modeling Discuss Machine Learning algorithms and their implementation Validate Machine Learning algorithms Explain Time Series and it’s related concepts Gain expertise to handle business in future, living the present - - - - - - - - - - - - - - - - - - - Why learn Machine Learning with Python? Data Science is a set of techniques that enables the computers to learn the desired behavior from data without explicitly being programmed. It employs techniques and theories drawn from many fields within the broad areas of mathematics, statistics, information science, and computer science. This course exposes you to different classes of machine learning algorithms like supervised, unsupervised and reinforcement algorithms. This course imparts you the necessary skills like data pre-processing, dimensional reduction, model evaluation and also exposes you to different machine learning algorithms like regression, clustering, decision trees, random forest, Naive Bayes and Q-Learning. 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

detail
{'title': 'Decision Tree Algorithm | Decision Tree in Python | Machine Learning Algorithms | Edureka', 'heatmap': [{'end': 980.385, 'start': 947.637, 'weight': 0.713}, {'end': 1344.57, 'start': 1314.884, 'weight': 0.832}, {'end': 2075.109, 'start': 2038.136, 'weight': 1}], 'summary': 'Covers the applications of machine learning, classification algorithms, decision trees, and decision tree classifier in python. it discusses name bias, knn algorithm, and decision tree models, emphasizing the importance of training and accuracy evaluation. it also demonstrates building a decision tree classifier using python, including functions for calculating information gain and classifying data.', 'chapters': [{'end': 181.537, 'segs': [{'end': 30.339, 'src': 'embed', 'start': 7.262, 'weight': 0, 'content': [{'end': 14.548, 'text': 'Open your eyes and see around, you will find dozens of applications of machine learning which you are using and interacting with in your daily life.', 'start': 7.262, 'duration': 7.286}, {'end': 20.892, 'text': 'be it be using the face detection algorithm in Facebook or getting the recommendation for similar products from Amazon,', 'start': 14.548, 'duration': 6.344}, {'end': 23.034, 'text': 'machine learning is applied almost everywhere.', 'start': 20.892, 'duration': 2.142}, {'end': 25.476, 'text': 'So hello and welcome all to this YouTube session.', 'start': 23.414, 'duration': 2.062}, {'end': 30.339, 'text': "This is Atul from Edureka and in today's session, we'll learn about how to build a decision tree.", 'start': 25.836, 'duration': 4.503}], 'summary': 'Machine learning is widely used in daily life applications like face detection in facebook and product recommendations from amazon.', 'duration': 23.077, 'max_score': 7.262, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU7262.jpg'}, {'end': 126.072, 'src': 'embed', 'start': 103.187, 'weight': 1, 'content': [{'end': 110.9, 'text': "So basically what you're doing is you're taking the data analyzing it and on the basis of some condition you finally divided into various categories.", 'start': 103.187, 'duration': 7.713}, {'end': 115.608, 'text': 'Now, why do we classify it? Well, we classify it to perform predictive analysis on it.', 'start': 111.421, 'duration': 4.187}, {'end': 122.45, 'text': 'like, when you get the mail, the machine predicts it to be a spam or not a spam mail and on the basis of that prediction,', 'start': 116.167, 'duration': 6.283}, {'end': 126.072, 'text': 'it add the irrelevant or spam mail to the respective folder.', 'start': 122.45, 'duration': 3.622}], 'summary': 'Data is classified for predictive analysis, e.g., predicting spam mail.', 'duration': 22.885, 'max_score': 103.187, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU103187.jpg'}], 'start': 7.262, 'title': 'Machine learning applications & decision trees', 'summary': 'Delves into the widespread applications of machine learning in daily life, including face detection in facebook and product recommendations on amazon. it emphasizes the process of classification, its use cases in predictive analysis, and its role in fraud detection.', 'chapters': [{'end': 181.537, 'start': 7.262, 'title': 'Machine learning applications & decision trees', 'summary': 'Explores the widespread applications of machine learning in daily life, such as face detection in facebook and product recommendations on amazon, and delves into the process of classification and its use cases, emphasizing its role in predictive analysis and fraud detection.', 'duration': 174.275, 'highlights': ['Machine learning is applied in various daily life applications, such as face detection in Facebook and product recommendations on Amazon. Quantifiable data: Demonstrates the widespread use of machine learning in daily life.', 'Classification is the process of dividing the data set into different categories or groups by adding labels, enabling predictive analysis and handling questions such as male or female categorization. Quantifiable data: Highlights the role of classification in predictive analysis and categorization.', 'The use of classification for fraud detection, such as in verifying genuine transactions and identifying suspicious activities, is emphasized. Quantifiable data: Illustrates the practical application of classification in fraud detection.']}], 'duration': 174.275, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU7262.jpg', 'highlights': ['Machine learning is applied in various daily life applications, such as face detection in Facebook and product recommendations on Amazon. Demonstrates the widespread use of machine learning in daily life.', 'The use of classification for fraud detection, such as in verifying genuine transactions and identifying suspicious activities, is emphasized. Illustrates the practical application of classification in fraud detection.', 'Classification is the process of dividing the data set into different categories or groups by adding labels, enabling predictive analysis and handling questions such as male or female categorization. Highlights the role of classification in predictive analysis and categorization.']}, {'end': 397.855, 'segs': [{'end': 209.26, 'src': 'embed', 'start': 182.137, 'weight': 0, 'content': [{'end': 185.26, 'text': 'So in order to confirm it it sends you a notification alert.', 'start': 182.137, 'duration': 3.123}, {'end': 186.04, 'text': 'All right.', 'start': 185.78, 'duration': 0.26}, {'end': 188.362, 'text': 'Well, this is one of the use case of classification.', 'start': 186.201, 'duration': 2.161}, {'end': 195.028, 'text': 'You can even use it to classify different items like fruits on the base of its taste, color, size or weight.', 'start': 188.643, 'duration': 6.385}, {'end': 201.814, 'text': 'a machine well trained using the classification algorithm can easily predict the class or the type of fruit whenever new data is given to it.', 'start': 195.028, 'duration': 6.786}, {'end': 203.135, 'text': 'Not just the fruit.', 'start': 202.414, 'duration': 0.721}, {'end': 204.496, 'text': 'It can be any item.', 'start': 203.275, 'duration': 1.221}, {'end': 205.637, 'text': 'It can be a car.', 'start': 204.696, 'duration': 0.941}, {'end': 206.698, 'text': 'It can be a house.', 'start': 205.857, 'duration': 0.841}, {'end': 209.26, 'text': 'It can be a sign board or anything.', 'start': 207.078, 'duration': 2.182}], 'summary': 'Classification algorithm can predict item type based on characteristics like taste, color, size, and weight.', 'duration': 27.123, 'max_score': 182.137, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU182137.jpg'}, {'end': 273.408, 'src': 'embed', 'start': 222.028, 'weight': 1, 'content': [{'end': 225.389, 'text': "For example, there are 10 images and you're selecting three images out of it.", 'start': 222.028, 'duration': 3.361}, {'end': 228.11, 'text': 'So, in a way, you are training the machine, right?', 'start': 225.829, 'duration': 2.281}, {'end': 235.531, 'text': "You're telling that these three are the picture of a car and rest are not, so who knows, you are training it for something big, right?", 'start': 228.35, 'duration': 7.181}, {'end': 236.952, 'text': 'So, moving on ahead.', 'start': 236.151, 'duration': 0.801}, {'end': 238.992, 'text': "Let's discuss the types of classification.", 'start': 236.992, 'duration': 2}, {'end': 239.976, 'text': 'All right.', 'start': 239.736, 'duration': 0.24}, {'end': 247.403, 'text': 'Well, there are several different ways to perform a same task, like in order to predict whether a given person is a male or a female,', 'start': 240.637, 'duration': 6.766}, {'end': 249.045, 'text': 'the machine had to be trained first.', 'start': 247.403, 'duration': 1.642}, {'end': 255.13, 'text': 'All right, but there are multiple ways to train the machine and you can choose any one of them just for predictive analytics.', 'start': 249.405, 'duration': 5.725}, {'end': 261.176, 'text': "There are many different techniques, but the most common of them all is the decision tree which will cover in depth in today's session.", 'start': 255.17, 'duration': 6.006}, {'end': 270.305, 'text': 'So as a part of classification algorithm we have decision tree, random, Forest neighbors, k, nearest neighbor, logistic regression, linear regression,', 'start': 261.676, 'duration': 8.629}, {'end': 272.247, 'text': 'support vector machines and so on.', 'start': 270.305, 'duration': 1.942}, {'end': 273.408, 'text': 'There are many all right.', 'start': 272.287, 'duration': 1.121}], 'summary': 'Training machine with 10 images, discussing various classification techniques including decision tree and predictive analytics.', 'duration': 51.38, 'max_score': 222.028, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU222028.jpg'}, {'end': 345.682, 'src': 'embed', 'start': 316.798, 'weight': 5, 'content': [{'end': 319.703, 'text': 'So this is about decision tree now moving on ahead.', 'start': 316.798, 'duration': 2.905}, {'end': 320.424, 'text': "Let's see.", 'start': 319.983, 'duration': 0.441}, {'end': 329.138, 'text': 'What is a random Forest will random Forest build multiple decision trees and merges them together to get a more accurate and stable prediction.', 'start': 320.845, 'duration': 8.293}, {'end': 329.94, 'text': 'All right.', 'start': 329.719, 'duration': 0.221}, {'end': 333.899, 'text': 'Most of the time random Forest is trained with a bagging method.', 'start': 330.638, 'duration': 3.261}, {'end': 341.021, 'text': 'The bagging method is based on the idea that the combination of learning model increases the overall result.', 'start': 334.459, 'duration': 6.562}, {'end': 345.682, 'text': 'if you are combining the learning from different models and then clubbing it together, what it will do.', 'start': 341.021, 'duration': 4.661}], 'summary': 'Random forest builds multiple decision trees for more accurate prediction using bagging method.', 'duration': 28.884, 'max_score': 316.798, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU316798.jpg'}, {'end': 397.855, 'src': 'embed', 'start': 374.168, 'weight': 6, 'content': [{'end': 382.13, 'text': 'You can see that in section a we have a large training data set what we do we first divide our training data set into n subsamples.', 'start': 374.168, 'duration': 7.962}, {'end': 385.991, 'text': 'All right and we create a decision tree for each sub sample.', 'start': 382.49, 'duration': 3.501}, {'end': 387.311, 'text': 'now, in the B part, what we do?', 'start': 385.991, 'duration': 1.32}, {'end': 390.352, 'text': 'we take the vote out of every decision made by every decision tree.', 'start': 387.311, 'duration': 3.041}, {'end': 395.053, 'text': 'and finally we club the vote to get the random forest decision fine.', 'start': 391.471, 'duration': 3.582}, {'end': 397.855, 'text': "Let's move on ahead next.", 'start': 395.914, 'duration': 1.941}], 'summary': 'Data set divided into n subsamples to create decision trees, aggregated for random forest decision.', 'duration': 23.687, 'max_score': 374.168, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU374168.jpg'}], 'start': 182.137, 'title': 'Classification algorithms and techniques', 'summary': 'Discusses the use of classification algorithms in machine learning for predicting types of items and image recognition, along with various techniques such as decision tree and random forest, emphasizing the importance of training for predictive analytics.', 'chapters': [{'end': 221.608, 'start': 182.137, 'title': 'Classification algorithms', 'summary': 'Discusses the use of classification algorithms in machine learning, highlighting its application in predicting the type of items such as fruits, cars, houses, and sign boards based on various attributes like taste, color, size, and weight, and also in image recognition tasks.', 'duration': 39.471, 'highlights': ['Classification algorithm can predict the type of fruit based on attributes like taste, color, size, and weight, as well as the type of other items, when new data is given.', 'It is also used in image recognition tasks, such as identifying images of cars or poles during website logins.', 'The use of classification algorithms is demonstrated through examples of classifying various items like fruits, cars, houses, and sign boards based on their attributes.']}, {'end': 397.855, 'start': 222.028, 'title': 'Machine learning: classification techniques', 'summary': 'Discusses the types of classification techniques, including decision tree and random forest, and highlights the importance of training the machine with various approaches for predictive analytics.', 'duration': 175.827, 'highlights': ['The chapter discusses the types of classification techniques, including decision tree and random forest. The chapter delves into various classification techniques, specifically focusing on decision tree and random forest as fundamental approaches.', 'The importance of training the machine with various approaches for predictive analytics is emphasized. The transcript emphasizes the significance of training the machine using different methods for predictive analytics, indicating the diverse ways to perform the same task.', 'The concept of random forest building multiple decision trees to get a more accurate and stable prediction is explained. The concept of random forest building multiple decision trees and merging them for a more accurate and stable prediction is highlighted, with an emphasis on training with a bagging method.', 'The process of dividing the training data set into subsamples and creating a decision tree for each subsample is described. The process of dividing the training data set into subsamples, creating a decision tree for each subsample, taking votes from each decision, and clubbing them to get the random forest decision is outlined.']}], 'duration': 215.718, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU182137.jpg', 'highlights': ['Classification algorithm predicts fruit type based on attributes like taste, color, size, and weight.', 'Classification algorithms used in image recognition tasks, such as identifying images of cars or poles during website logins.', 'Demonstrates the use of classification algorithms through examples of classifying various items based on their attributes.', 'Chapter discusses types of classification techniques, focusing on decision tree and random forest as fundamental approaches.', 'Emphasizes the importance of training the machine with various approaches for predictive analytics.', 'Explains the concept of random forest building multiple decision trees for a more accurate and stable prediction.', 'Describes the process of dividing the training data set into subsamples and creating a decision tree for each subsample.']}, {'end': 632.101, 'segs': [{'end': 445.052, 'src': 'embed', 'start': 398.135, 'weight': 0, 'content': [{'end': 399.576, 'text': 'We have name bias.', 'start': 398.135, 'duration': 1.441}, {'end': 404.479, 'text': 'So name bias is a classification technique, which is based on Bayes theorem.', 'start': 400.336, 'duration': 4.143}, {'end': 411.703, 'text': 'It assumes that presence of any particular feature in a class is completely unrelated to the presence of any other feature.', 'start': 405.019, 'duration': 6.684}, {'end': 417.163, 'text': 'Name is a simple and easy to implement algorithm and due to a simplicity,', 'start': 412.381, 'duration': 4.782}, {'end': 422.665, 'text': 'this algorithm might outperform more complex model when the size of the data set is not large enough.', 'start': 417.163, 'duration': 5.502}, {'end': 428.328, 'text': 'All right, a classical use case of name bias is a document classification and that what you do,', 'start': 423.005, 'duration': 5.323}, {'end': 433.25, 'text': 'you determine whether given text corresponds to one or more categories.', 'start': 428.328, 'duration': 4.922}, {'end': 437.471, 'text': 'in the text case, the features used might be the presence or absence of any keyword.', 'start': 433.25, 'duration': 4.221}, {'end': 439.032, 'text': 'So this was about name.', 'start': 437.931, 'duration': 1.101}, {'end': 445.052, 'text': 'From the diagram, you can see that using nay bias, we have to decide whether we have a disease or not.', 'start': 439.767, 'duration': 5.285}], 'summary': 'Name bias is a classification technique based on bayes theorem, which can outperform complex models for small datasets. it is commonly used in document classification and disease diagnosis.', 'duration': 46.917, 'max_score': 398.135, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU398135.jpg'}, {'end': 488.668, 'src': 'embed', 'start': 466.831, 'weight': 4, 'content': [{'end': 477.862, 'text': "so probability of having a positive test when you're having a disease is 0.80 and probability of a negative test when you already have a disease that is 0.20..", 'start': 466.831, 'duration': 11.031}, {'end': 485.449, 'text': "This is also a false negative statement as the test is detecting negative, but you still have the disease, right? So it's a false negative statement.", 'start': 477.862, 'duration': 7.587}, {'end': 488.668, 'text': "Now, let's move ahead when you don't have the disease at all.", 'start': 486.067, 'duration': 2.601}], 'summary': 'Probability of positive test with disease: 0.80. false negative detection explained.', 'duration': 21.837, 'max_score': 466.831, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU466831.jpg'}, {'end': 577.038, 'src': 'embed', 'start': 555.72, 'weight': 5, 'content': [{'end': 566.169, 'text': 'Well, the modern systems are now able to use the k-nearest neighbor for visual pattern recognition to scan and detect hidden packages in the bottom bin of a shopping cart at the checkout.', 'start': 555.72, 'duration': 10.449}, {'end': 572.294, 'text': 'If an object is detected which matches exactly to the object listed in the database,', 'start': 566.569, 'duration': 5.725}, {'end': 577.038, 'text': 'then the price of the spotted product could even automatically be added to the customers bill.', 'start': 572.294, 'duration': 4.744}], 'summary': 'Modern systems use k-nearest neighbor for visual pattern recognition to scan and detect hidden packages in shopping cart bins at checkout.', 'duration': 21.318, 'max_score': 555.72, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU555720.jpg'}], 'start': 398.135, 'title': 'Name bias and knn algorithm', 'summary': 'Explains name bias in classification and its potential in outperforming complex models with small datasets, and discusses the probabilities of disease detection, knn algorithm in data analysis, and its applications in visual pattern recognition and retail transaction analysis.', 'chapters': [{'end': 445.052, 'start': 398.135, 'title': 'Name bias in classification', 'summary': 'Explains the concept of name bias in classification, highlighting its use in document classification and disease prediction, and its potential to outperform more complex models with small datasets.', 'duration': 46.917, 'highlights': ['Name bias is a classification technique based on Bayes theorem, assuming that the presence of any particular feature in a class is completely unrelated to the presence of any other feature.', 'The algorithm of name bias, due to its simplicity, might outperform more complex models when the size of the dataset is not large enough.', 'A classical use case of name bias is document classification, where it determines whether a given text corresponds to one or more categories based on the presence or absence of keywords.', 'Using name bias, decisions can be made about the presence of a disease based on certain features.']}, {'end': 632.101, 'start': 445.592, 'title': 'Probability and knn algorithm in data analysis', 'summary': 'Discusses the probabilities of disease detection and the knn algorithm in data analysis, including the probabilities of false positive and false negative statements, as well as the applications of knn in visual pattern recognition and retail transaction analysis.', 'duration': 186.509, 'highlights': ['The probability of having a positive test when having a disease is 0.80, and the probability of a negative test when having a disease is 0.20, indicating false positive and false negative statements.', 'KNN algorithm is used for visual pattern recognition, such as detecting hidden packages in shopping carts and in retail to detect patterns in credit card usage.', 'The use of KNN in retail includes spotting unusual patterns in register data, indicating suspicious activities like manual entry of customer information or misuse of return policies.']}], 'duration': 233.966, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU398135.jpg', 'highlights': ['Name bias is a classification technique based on Bayes theorem, assuming feature independence.', 'Name bias may outperform complex models with small datasets due to its simplicity.', 'Document classification is a classical use case of name bias.', 'Decisions about disease presence can be made using name bias and certain features.', 'Probability of positive test when having a disease is 0.80, and negative test is 0.20.', 'KNN algorithm is used for visual pattern recognition and in retail for detecting patterns.', 'KNN in retail includes spotting unusual patterns in register data for fraud detection.']}, {'end': 1614.514, 'segs': [{'end': 690.935, 'src': 'embed', 'start': 653.232, 'weight': 0, 'content': [{'end': 660.875, 'text': 'it belongs to one of the few models that interpretable, where you can understand exactly why the classifier has made that particular decision.', 'start': 653.232, 'duration': 7.643}, {'end': 667.962, 'text': 'Right Let me tell you a fact that for a given data set you cannot say that this algorithm performs better than that.', 'start': 661.758, 'duration': 6.204}, {'end': 674.225, 'text': "It's like you cannot say that decision trees better than a bias or name biases performing better than decision tree.", 'start': 668.322, 'duration': 5.903}, {'end': 675.886, 'text': 'It depends on the data set.', 'start': 674.605, 'duration': 1.281}, {'end': 682.03, 'text': 'right. you have to apply hidden trial method with all the algorithms one by one and then compare the result.', 'start': 675.886, 'duration': 6.144}, {'end': 687.113, 'text': 'the model which gives the best result is the model which you can use it for better accuracy for your data set.', 'start': 682.03, 'duration': 5.083}, {'end': 687.773, 'text': 'All right.', 'start': 687.573, 'duration': 0.2}, {'end': 690.935, 'text': "So let's start with what is decision tree.", 'start': 688.654, 'duration': 2.281}], 'summary': 'Interpretable model; best algorithm depends on data set; compare results to find best model.', 'duration': 37.703, 'max_score': 653.232, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU653232.jpg'}, {'end': 784.533, 'src': 'embed', 'start': 750.29, 'weight': 2, 'content': [{'end': 753.952, 'text': 'So this keeps on repeating until you finally get to the right person, right?', 'start': 750.29, 'duration': 3.662}, {'end': 758.996, 'text': 'You might think that you are caught in a voicemail hell, but what the company was actually doing?', 'start': 754.493, 'duration': 4.503}, {'end': 762.038, 'text': 'it was just using a decision tree to get you to the right person.', 'start': 758.996, 'duration': 3.042}, {'end': 765.48, 'text': "All right, I'd like you to focus on this particular image for a moment.", 'start': 762.478, 'duration': 3.002}, {'end': 767.016, 'text': 'On this particular slide.', 'start': 766.155, 'duration': 0.861}, {'end': 769.418, 'text': 'You can see image where the task is.', 'start': 767.036, 'duration': 2.382}, {'end': 771.721, 'text': 'should I accept a new job offer or not?', 'start': 769.418, 'duration': 2.303}, {'end': 773.803, 'text': 'All right, so you have to decide that.', 'start': 772.201, 'duration': 1.602}, {'end': 776.746, 'text': 'for that, what you did you created a decision tree,', 'start': 773.803, 'duration': 2.943}, {'end': 782.211, 'text': 'starting with the base condition or the root node was that the basic salary or the minimum salary should be $50,000.', 'start': 776.746, 'duration': 5.465}, {'end': 784.533, 'text': 'if it is not $50,000, then you are not at all accepting the offer.', 'start': 782.211, 'duration': 2.322}], 'summary': 'Companies use decision trees to direct calls efficiently. decision tree used to evaluate job offers.', 'duration': 34.243, 'max_score': 750.29, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU750290.jpg'}, {'end': 980.385, 'src': 'heatmap', 'start': 947.637, 'weight': 0.713, 'content': [{'end': 963.83, 'text': 'and to do that we need to quantify how much question helps to unmix the label and we can quantify the amount of uncertainty at a single node using a metric called Ginny impurity and we can quantify how much a question reduces that uncertainty using a concept called information game,', 'start': 947.637, 'duration': 16.193}, {'end': 969.935, 'text': "will use these to select the best question to ask at each point and then what we'll do will iterate the steps,", 'start': 963.83, 'duration': 6.105}, {'end': 972.477, 'text': 'will recursively build a tree on each of the new node.', 'start': 969.935, 'duration': 2.542}, {'end': 978.644, 'text': "We'll continue dividing the data until there are no further question to ask and finally we reach to our leaf.", 'start': 973.001, 'duration': 5.643}, {'end': 979.324, 'text': 'All right.', 'start': 979.124, 'duration': 0.2}, {'end': 980.385, 'text': 'All right.', 'start': 980.125, 'duration': 0.26}], 'summary': "Quantify question's impact using gini impurity & information gain to build a tree.", 'duration': 32.748, 'max_score': 947.637, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU947637.jpg'}, {'end': 1357.699, 'src': 'heatmap', 'start': 1314.884, 'weight': 4, 'content': [{'end': 1315.925, 'text': "It's something less than that.", 'start': 1314.884, 'duration': 1.041}, {'end': 1323.49, 'text': 'Well, it could be possible that I pick banana from the basket and when I randomly pick the label from the ball it says a cherry.', 'start': 1316.645, 'duration': 6.845}, {'end': 1325.952, 'text': 'any random permutation and combination can be possible.', 'start': 1323.49, 'duration': 2.462}, {'end': 1329.825, 'text': 'So in this case, I would say that impurities is nonzero.', 'start': 1326.604, 'duration': 3.221}, {'end': 1332.386, 'text': 'I hope the concept of impurity is clear.', 'start': 1330.365, 'duration': 2.021}, {'end': 1338.448, 'text': 'So coming back to entropy as I said entropy is the measure of impurity from the graph on your left.', 'start': 1332.906, 'duration': 5.542}, {'end': 1344.57, 'text': 'You can see that as the probability is 0 or 1, that is, either they are highly impure or they are highly pure,', 'start': 1338.508, 'duration': 6.062}, {'end': 1351.512, 'text': 'then in that case the value of entropy is 0, and when the probability is 0.5,, then the value of entropy is maximum.', 'start': 1344.57, 'duration': 6.942}, {'end': 1353.557, 'text': 'Well, what is impurity?', 'start': 1352.037, 'duration': 1.52}, {'end': 1357.699, 'text': 'impurity is the degree of randomness, how random a data is.', 'start': 1353.557, 'duration': 4.142}], 'summary': 'Entropy measures impurity, reaching maximum at 0.5 probability.', 'duration': 42.815, 'max_score': 1314.884, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU1314884.jpg'}, {'end': 1579.02, 'src': 'embed', 'start': 1531.769, 'weight': 5, 'content': [{'end': 1542.293, 'text': 'so this was all about entropy all right next is what is information gain Well information gain what it does it measures the reduction in entropy.', 'start': 1531.769, 'duration': 10.524}, {'end': 1545.994, 'text': 'It decides which attribute should be selected as the decision node.', 'start': 1542.953, 'duration': 3.041}, {'end': 1552.676, 'text': 'If s is our total collection, then information gain equals entropy, which we calculated just now,', 'start': 1546.574, 'duration': 6.102}, {'end': 1557.057, 'text': 'that minus weighted average multiplied by entropy of each feature.', 'start': 1552.676, 'duration': 4.381}, {'end': 1557.757, 'text': "Don't worry.", 'start': 1557.397, 'duration': 0.36}, {'end': 1560.698, 'text': "We'll just see how to calculate it with an example.", 'start': 1557.777, 'duration': 2.921}, {'end': 1561.158, 'text': 'All right.', 'start': 1560.898, 'duration': 0.26}, {'end': 1568.5, 'text': "So let's manually build a decision tree for our data set.", 'start': 1566.119, 'duration': 2.381}, {'end': 1574.339, 'text': 'So this is our data set which consists of 14 different instances out of which we have nine.', 'start': 1569.218, 'duration': 5.121}, {'end': 1575.379, 'text': 'Yes and five.', 'start': 1574.419, 'duration': 0.96}, {'end': 1576.18, 'text': 'No, all right.', 'start': 1575.46, 'duration': 0.72}, {'end': 1579.02, 'text': 'So we have the formula for entropy.', 'start': 1576.92, 'duration': 2.1}], 'summary': 'Entropy measures reduction in information; information gain selects decision node based on weighted average.', 'duration': 47.251, 'max_score': 1531.769, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU1531769.jpg'}], 'start': 632.841, 'title': 'Decision trees and basics', 'summary': 'Discusses the concept, interpretability, and practical applications of decision trees, emphasizing evaluating multiple algorithms for accuracy. it explains decision making, setting a minimum salary threshold of $50,000, using the cart algorithm, and covers terminologies such as gini index, information gain, and entropy for classification.', 'chapters': [{'end': 769.418, 'start': 632.841, 'title': 'Introduction to decision trees', 'summary': 'Discusses the concept of decision trees, highlighting their interpretability and practical applications, emphasizing the importance of evaluating multiple algorithms for better accuracy and explaining decision trees through a real-life scenario.', 'duration': 136.577, 'highlights': ["Decision trees are chosen for their interpretability and ease of understanding, making them one of the few models where the classifier's decision-making process can be comprehended. Decision trees are known for their interpretability and ease of understanding, standing out as one of the few models where the classifier's decision-making process can be comprehended.", 'The importance of evaluating multiple algorithms to find the one that provides the best result for a given dataset is emphasized, highlighting the need for a trial-and-error approach to compare and select the most accurate model. Emphasizes the importance of evaluating multiple algorithms to find the best result for a given dataset, advocating a trial-and-error approach to compare and select the most accurate model.', 'Explains the concept of decision trees using a real-life scenario of navigating through a phone menu system, demonstrating the practical application of decision trees in directing callers to the appropriate assistance. Utilizes a real-life scenario of navigating through a phone menu system to explain the practical application of decision trees in directing callers to the appropriate assistance.']}, {'end': 1130.133, 'start': 769.418, 'title': 'Decision tree basics', 'summary': 'Explains the process of decision making using a decision tree, which involves setting a minimum salary threshold of $50,000, considering commute time and benefits like free coffee, and using the cart algorithm to build a tree for classification and regression, aiming to unmix labels and reduce uncertainty.', 'duration': 360.715, 'highlights': ['The chapter explains the process of decision making using a decision tree It involves setting a minimum salary threshold of $50,000, considering commute time and benefits like free coffee, and using the CART algorithm to build a tree for classification and regression.', 'Setting a minimum salary threshold of $50,000 The decision-making process starts with this base condition, where a salary below $50,000 leads to rejecting the job offer.', 'Using the CART algorithm to build a tree for classification and regression The chapter explores the process of building a decision tree using the CART algorithm, aiming to unmix labels and reduce uncertainty at each node to make informed decisions.', 'Considering commute time and benefits like free coffee The decision tree involves evaluating factors like commute time and the availability of perks such as free coffee to determine whether to accept or decline a job offer.']}, {'end': 1614.514, 'start': 1130.133, 'title': 'Decision tree basics', 'summary': 'Explains the basics of creating a decision tree, including terminologies such as gini index, information gain, reduction in variance, and entropy, with a focus on determining the best attribute for classification.', 'duration': 484.381, 'highlights': ['The chapter introduces the concept of entropy as a measure of impurity, explaining that it is the first step in solving the problem of a decision tree. Entropy is defined as a metric that measures the impurity of data, with examples of scenarios with varying impurity levels.', 'The explanation of information gain is provided as a measure of the reduction in entropy, which determines the selection of decision nodes. Information gain is described as the difference between the initial entropy and the weighted average of entropy for each feature, influencing the selection of decision nodes.', 'The computation of entropy for the entire dataset is demonstrated and used to determine the best attribute for the root node of the decision tree. The process of computing entropy for a dataset is exemplified, providing insights into selecting the root node for the decision tree.']}], 'duration': 981.673, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU632841.jpg', 'highlights': ["Decision trees are chosen for their interpretability and ease of understanding, making them one of the few models where the classifier's decision-making process can be comprehended.", 'The importance of evaluating multiple algorithms to find the one that provides the best result for a given dataset is emphasized, highlighting the need for a trial-and-error approach to compare and select the most accurate model.', 'Explains the concept of decision trees using a real-life scenario of navigating through a phone menu system, demonstrating the practical application of decision trees in directing callers to the appropriate assistance.', 'The chapter explains the process of decision making using a decision tree It involves setting a minimum salary threshold of $50,000, considering commute time and benefits like free coffee, and using the CART algorithm to build a tree for classification and regression.', 'The chapter introduces the concept of entropy as a measure of impurity, explaining that it is the first step in solving the problem of a decision tree.', 'The explanation of information gain is provided as a measure of the reduction in entropy, which determines the selection of decision nodes.', 'The computation of entropy for the entire dataset is demonstrated and used to determine the best attribute for the root node of the decision tree.']}, {'end': 2255.406, 'segs': [{'end': 1640.858, 'src': 'embed', 'start': 1615.174, 'weight': 4, 'content': [{'end': 1621.376, 'text': 'So you have to do it one by one you have to calculate the entropy and information gain for all of the different nodes.', 'start': 1615.174, 'duration': 6.202}, {'end': 1628.133, 'text': 'So starting with Outlook so Outlook has three different parameters Sunny overcast and rainy.', 'start': 1622.091, 'duration': 6.042}, {'end': 1632.355, 'text': 'So, first of all, select how many number of yes and no are there?', 'start': 1628.613, 'duration': 3.742}, {'end': 1637.417, 'text': 'in the case of Sunny, like when it is Sunny, how many number of yes and how many number of nos are there?', 'start': 1632.355, 'duration': 5.062}, {'end': 1640.858, 'text': 'So in total we have two yes and three nos in case of Sunny.', 'start': 1637.817, 'duration': 3.041}], 'summary': "Calculate entropy and information gains for outlook's three parameters: sunny, overcast, and rainy.", 'duration': 25.684, 'max_score': 1615.174, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU1615174.jpg'}, {'end': 1688.209, 'src': 'embed', 'start': 1662.293, 'weight': 1, 'content': [{'end': 1667.938, 'text': 'first of all, we are assuming that Outlook is our root node and for that we are calculating the information gain for it.', 'start': 1662.293, 'duration': 5.645}, {'end': 1668.398, 'text': 'All right.', 'start': 1668.198, 'duration': 0.2}, {'end': 1675.202, 'text': 'So, in order to calculate the information gain, remember the formula it was entropy of the total sample space minus weighted average,', 'start': 1668.999, 'duration': 6.203}, {'end': 1677.003, 'text': 'multiplied by entropy of each feature.', 'start': 1675.202, 'duration': 1.801}, {'end': 1677.463, 'text': 'All right.', 'start': 1677.263, 'duration': 0.2}, {'end': 1681.885, 'text': 'So what we are doing here, we are calculating the entropy of Outlook when it was sunny.', 'start': 1677.883, 'duration': 4.002}, {'end': 1688.209, 'text': 'So total number of years when it was sunny was 2 and total number of no that was 3 fine.', 'start': 1682.386, 'duration': 5.823}], 'summary': 'Calculating information gain for outlook with 2 sunny years and 3 not sunny.', 'duration': 25.916, 'max_score': 1662.293, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU1662293.jpg'}, {'end': 2075.109, 'src': 'heatmap', 'start': 1997.251, 'weight': 0, 'content': [{'end': 2004.735, 'text': 'So for that what you will do so total information gained from Wendy that equals to total entropy minus information taken from Wendy.', 'start': 1997.251, 'duration': 7.484}, {'end': 2006.917, 'text': 'All right, that is 0.94 minus 0.892 that equals to 0.048.', 'start': 2005.136, 'duration': 1.781}, {'end': 2008.658, 'text': 'So 0.048 is the information gained from Wendy.', 'start': 2006.917, 'duration': 1.741}, {'end': 2009.338, 'text': 'All right.', 'start': 2008.938, 'duration': 0.4}, {'end': 2022.562, 'text': 'Similarly we calculated for the rest to all right.', 'start': 2019.814, 'duration': 2.748}, {'end': 2029.973, 'text': 'So, for Outlook, as you can see, the information was 0.693 and its information gain was 0.247.', 'start': 2023.211, 'duration': 6.762}, {'end': 2038.136, 'text': 'in case of temperature, the information was around 0.911 and the information gain that was equal to 0.029.', 'start': 2029.973, 'duration': 8.163}, {'end': 2045.779, 'text': 'in case of humidity, the information gain was 0.152 and in the case of windy, the information gain was 0.048..', 'start': 2038.136, 'duration': 7.643}, {'end': 2049.679, 'text': "So what we'll do will select the attribute with the maximum fine.", 'start': 2045.779, 'duration': 3.9}, {'end': 2057.266, 'text': 'Now we are selected Outlook as our root node and it is further subdivided into three different parts sunny overcast and rain.', 'start': 2050.36, 'duration': 6.906}, {'end': 2063.313, 'text': 'So in case of overcast we have seen that it consists of all yes, so we can consider it as a leaf node.', 'start': 2057.647, 'duration': 5.666}, {'end': 2069.398, 'text': "But in case of sunny and rainy, it's doubtful as it consists of both yes and both no.", 'start': 2064.233, 'duration': 5.165}, {'end': 2075.109, 'text': 'So you need to recalculate the things right? Again for this node, you have to recalculate the things.', 'start': 2069.759, 'duration': 5.35}], 'summary': 'Entropy calculation and information gain for decision tree attributes, selecting root node based on maximum gain, subdividing into leaf nodes', 'duration': 52.428, 'max_score': 1997.251, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU1997251.jpg'}, {'end': 2135.201, 'src': 'embed', 'start': 2108.066, 'weight': 5, 'content': [{'end': 2113.708, 'text': "But if it has strong wind then you won't play right? So this is how your entire decision tree would look like at the end.", 'start': 2108.066, 'duration': 5.642}, {'end': 2114.428, 'text': 'All right.', 'start': 2113.728, 'duration': 0.7}, {'end': 2128.633, 'text': 'Okay now comes the concept of pruning says that what should I do to play? Well, you have to do pruning pruning will decide how you will play.', 'start': 2119.87, 'duration': 8.763}, {'end': 2135.201, 'text': 'What is this pruning? Well, this pruning is nothing but cutting down the nodes in order to get the optimal solution.', 'start': 2129.234, 'duration': 5.967}], 'summary': 'Pruning determines optimal play by cutting down nodes.', 'duration': 27.135, 'max_score': 2108.066, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU2108066.jpg'}, {'end': 2209.175, 'src': 'embed', 'start': 2183.186, 'weight': 6, 'content': [{'end': 2187.348, 'text': "Let's look at some key factor which will help you to decide which algorithm to use and when.", 'start': 2183.186, 'duration': 4.162}, {'end': 2194.95, 'text': 'So the first point being if the relationship between dependent and independent variable is well approximated by a linear model,', 'start': 2187.868, 'duration': 7.082}, {'end': 2198.651, 'text': 'then linear regression will outperform tree based model.', 'start': 2194.95, 'duration': 3.701}, {'end': 2205.714, 'text': 'second case if there is a high non-linearity and complex relationship between dependent and independent variables,', 'start': 2198.651, 'duration': 7.063}, {'end': 2209.175, 'text': 'a tree model will outperform a classical regression model.', 'start': 2205.714, 'duration': 3.461}], 'summary': 'Linear regression outperforms tree model for linear relationships, while tree model excels for high non-linearity and complex relationships.', 'duration': 25.989, 'max_score': 2183.186, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU2183186.jpg'}, {'end': 2249.943, 'src': 'embed', 'start': 2222.65, 'weight': 7, 'content': [{'end': 2229.114, 'text': "Now, let's move on ahead and see how you can write a decision tree classifier from scratch and python using the cart algorithm.", 'start': 2222.65, 'duration': 6.464}, {'end': 2229.814, 'text': 'All right.', 'start': 2229.594, 'duration': 0.22}, {'end': 2234.333, 'text': "For this I'll be using Jupiter notebook with python 3.0 installed on it.", 'start': 2230.45, 'duration': 3.883}, {'end': 2237.635, 'text': "All right, so let's open the Anaconda and the Jupiter notebook.", 'start': 2234.533, 'duration': 3.102}, {'end': 2243.619, 'text': "Where is that? So there's a Anaconda Navigator and I'll directly jump over to Jupiter notebook and hit the launch button.", 'start': 2237.735, 'duration': 5.884}, {'end': 2249.943, 'text': 'I guess everyone knows that Jupiter notebook is a web-based interactive computing notebook environment where you can run your python codes.', 'start': 2244.079, 'duration': 5.864}], 'summary': 'Learn to write a decision tree classifier using python in jupyter notebook.', 'duration': 27.293, 'max_score': 2222.65, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU2222650.jpg'}], 'start': 1615.174, 'title': 'Decision tree models', 'summary': 'Covers the calculation of information gain for decision trees, including entropy calculation for nodes, yielding a final information gain value of 0.247. it also discusses the construction of decision trees, attribute selection, pruning, and comparison with linear models, concluding with a demonstration of a decision tree classifier using the cart algorithm in python.', 'chapters': [{'end': 1844.528, 'start': 1615.174, 'title': 'Calculating information gain for decision trees', 'summary': 'Discusses the process of calculating the information gain for the outlook feature in a decision tree, with key points including the calculation of entropy for different nodes and the final information gain value of 0.247.', 'duration': 229.354, 'highlights': ['The chapter discusses the process of calculating the information gain for the Outlook feature in a decision tree The transcript elaborates on the step-by-step process of calculating the information gain for the Outlook feature in a decision tree, emphasizing the importance of this calculation in building a decision tree model.', 'Calculation of entropy for different nodes The transcript provides a detailed explanation of calculating entropy for the different nodes of the Outlook feature, including the values for Sunny, Overcast, and Rainy, with quantifiable data of yes and no counts for each node.', 'The final information gain value of 0.247 The chapter concludes with the computation of the information gain from the Outlook feature, resulting in a final information gain value of 0.247, which is a crucial metric in decision tree construction.']}, {'end': 2255.406, 'start': 1844.789, 'title': 'Decision tree classifier and pruning', 'summary': "Discusses the calculation of entropy and information gained from the root node 'wendy', followed by the selection of attributes with maximum information gain to construct a decision tree. additionally, it emphasizes the concept of pruning in decision tree models and compares the use of tree-based models with linear models based on key factors. it concludes with a demonstration of writing a decision tree classifier using the cart algorithm in python.", 'duration': 410.617, 'highlights': ["The chapter focuses on the calculation of entropy and information gained from the root node 'Wendy', presenting the calculation results such as entropy of false as 0.811 and information gained from Wendy as 0.048.", "It emphasizes the selection of attributes with maximum information gain to construct a decision tree, with specific examples like selecting 'Outlook' as the root node and further subdividing it into 'sunny', 'overcast', and 'rain' based on information gain.", 'The concept of pruning in decision tree models is introduced, highlighting its role in reducing complexity and achieving the optimal solution by cutting down nodes.', 'The comparison between tree-based models and linear models is presented, discussing key factors such as the relationship between dependent and independent variables, non-linearity, complexity, and interpretability of the models.', 'A demonstration of writing a decision tree classifier using the CART algorithm in Python is provided, including the use of Jupyter notebook and the Anaconda environment for interactive computing.']}], 'duration': 640.232, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU1615174.jpg', 'highlights': ['The chapter concludes with the computation of the information gain from the Outlook feature, resulting in a final information gain value of 0.247, which is a crucial metric in decision tree construction.', 'The chapter discusses the process of calculating the information gain for the Outlook feature in a decision tree, emphasizing the importance of this calculation in building a decision tree model.', 'The transcript elaborates on the step-by-step process of calculating the information gain for the Outlook feature in a decision tree.', "The chapter focuses on the calculation of entropy and information gained from the root node 'Wendy', presenting the calculation results such as entropy of false as 0.811 and information gained from Wendy as 0.048.", "It emphasizes the selection of attributes with maximum information gain to construct a decision tree, with specific examples like selecting 'Outlook' as the root node and further subdividing it into 'sunny', 'overcast', and 'rain' based on information gain.", 'The concept of pruning in decision tree models is introduced, highlighting its role in reducing complexity and achieving the optimal solution by cutting down nodes.', 'The comparison between tree-based models and linear models is presented, discussing key factors such as the relationship between dependent and independent variables, non-linearity, complexity, and interpretability of the models.', 'A demonstration of writing a decision tree classifier using the CART algorithm in Python is provided, including the use of Jupyter notebook and the Anaconda environment for interactive computing.', 'Calculation of entropy for different nodes The transcript provides a detailed explanation of calculating entropy for the different nodes of the Outlook feature, including the values for Sunny, Overcast, and Rainy, with quantifiable data of yes and no counts for each node.']}, {'end': 2486.154, 'segs': [{'end': 2292.305, 'src': 'embed', 'start': 2255.406, 'weight': 0, 'content': [{'end': 2259.709, 'text': "So I'll be using this Jupiter notebook in order to write my decision tree classifier using python.", 'start': 2255.406, 'duration': 4.303}, {'end': 2261.835, 'text': 'For this decision tree classifier.', 'start': 2260.293, 'duration': 1.542}, {'end': 2264.257, 'text': 'I have already written the set of codes.', 'start': 2262.095, 'duration': 2.162}, {'end': 2265.638, 'text': 'Let me explain you just one by one.', 'start': 2264.337, 'duration': 1.301}, {'end': 2269.241, 'text': "So we'll start with initializing our training data set.", 'start': 2266.419, 'duration': 2.822}, {'end': 2273.225, 'text': "So there's a sample data set for which each row is an example.", 'start': 2269.622, 'duration': 3.603}, {'end': 2280.372, 'text': 'The last column is a label and the first two columns are the features if you want you can add some more features an example for your practice.', 'start': 2273.565, 'duration': 6.807}, {'end': 2287.162, 'text': 'Interesting fact is that this data set is designed in a way that the second and a fifth example have almost the same features,', 'start': 2280.999, 'duration': 6.163}, {'end': 2288.463, 'text': 'but they have different labels.', 'start': 2287.162, 'duration': 1.301}, {'end': 2292.305, 'text': "All right, so let's move on and see how the tree handles this case.", 'start': 2288.803, 'duration': 3.502}], 'summary': 'Using python, a decision tree classifier is implemented in a jupyter notebook, with a designed sample dataset showcasing features and labels.', 'duration': 36.899, 'max_score': 2255.406, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU2255406.jpg'}, {'end': 2414.145, 'src': 'embed', 'start': 2360.931, 'weight': 2, 'content': [{'end': 2365.333, 'text': 'We are counting the unique values for the label in the data set as a sample you can see here.', 'start': 2360.931, 'duration': 4.402}, {'end': 2370.256, 'text': 'We can pass that entire training data set to this particular function as class underscore count what it will do.', 'start': 2365.573, 'duration': 4.683}, {'end': 2377.221, 'text': 'It will find all the different types of label within the training data set as you can see here the unique label consists of mango grape and lemon.', 'start': 2370.317, 'duration': 6.904}, {'end': 2382.765, 'text': "So next what we'll do will define a function is numeric and will pass a value into it.", 'start': 2378.044, 'duration': 4.721}, {'end': 2389.447, 'text': 'So what it will do it will just test if the value is numeric or not and it will return if the value is an integer or a float.', 'start': 2382.965, 'duration': 6.482}, {'end': 2391.948, 'text': 'For example, you can see is numeric.', 'start': 2389.988, 'duration': 1.96}, {'end': 2392.828, 'text': 'We are passing seven.', 'start': 2391.968, 'duration': 0.86}, {'end': 2393.809, 'text': 'So it has an integer.', 'start': 2392.868, 'duration': 0.941}, {'end': 2401.331, 'text': "So it will return an int value and if you are passing red, it's not a numeric value, right? So moving on ahead will define a class named as question.", 'start': 2393.929, 'duration': 7.402}, {'end': 2405.352, 'text': 'So what this question does this question is used to partition the data set.', 'start': 2401.631, 'duration': 3.721}, {'end': 2410.362, 'text': 'This class what it does it just records a column number for example 0 for color.', 'start': 2405.979, 'duration': 4.383}, {'end': 2414.145, 'text': 'All right and a column value for example green next what we are doing.', 'start': 2410.582, 'duration': 3.563}], 'summary': 'The transcript discusses counting unique label values, testing for numeric values, and defining a class for data set partitioning.', 'duration': 53.214, 'max_score': 2360.931, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU2360931.jpg'}, {'end': 2482.091, 'src': 'embed', 'start': 2453.333, 'weight': 5, 'content': [{'end': 2457.998, 'text': 'if it does so, it adds it to the true rows or, if not, then it adds to the false rows.', 'start': 2453.333, 'duration': 4.665}, {'end': 2464.265, 'text': "All right, for example, as you can see here, let's partition the training data set based on whether the rows are read or not.", 'start': 2458.478, 'duration': 5.787}, {'end': 2468.681, 'text': 'Here we are calling the function question and we are passing a value of 0 and red to it.', 'start': 2464.818, 'duration': 3.863}, {'end': 2476.747, 'text': 'So what it will do it will assign all the red Rose to true underscore Rose and everything else will be assigned to false underscore Rose fine.', 'start': 2469.101, 'duration': 7.646}, {'end': 2482.091, 'text': "Next what we'll do will define a genuine priority function and inside that will pass the list of Rose.", 'start': 2477.047, 'duration': 5.044}], 'summary': 'Partition training data based on color to true/false rows.', 'duration': 28.758, 'max_score': 2453.333, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU2453333.jpg'}], 'start': 2255.406, 'title': 'Decision tree classifier in python', 'summary': 'Introduces the process of building a decision tree classifier using python, including initializing the training dataset, adding column labels, defining functions to find unique values, and counting the number of each type of example, with a sample dataset consisting of mango, grape, and lemon labels.', 'chapters': [{'end': 2377.221, 'start': 2255.406, 'title': 'Decision tree classifier in python', 'summary': 'Introduces the process of building a decision tree classifier using python, including initializing the training dataset, adding column labels, defining functions to find unique values and count the number of each type of example, with a sample dataset consisting of mango, grape, and lemon labels.', 'duration': 121.815, 'highlights': ['The chapter introduces the process of building a decision tree classifier using Python, including initializing the training dataset, adding column labels, defining functions to find unique values and count the number of each type of example, with a sample dataset consisting of mango, grape, and lemon labels.', 'The sample dataset has rows representing examples, where the last column is the label and the first two columns are features, with an interesting fact that the second and fifth examples have almost the same features but different labels.', 'Functions are defined to find unique values for a column in the dataset and to count the number of each type of example, with a sample dataset containing unique labels of mango, grape, and lemon.']}, {'end': 2486.154, 'start': 2378.044, 'title': 'Defining functions and classes for data processing', 'summary': "Covers the definition of a function 'is_numeric' to test if a value is numeric, the creation of a class 'question' to partition the dataset, and the implementation of methods like 'match' and 'partition' to compare feature values and divide the dataset, with an example of partitioning the training dataset based on a specific condition.", 'duration': 108.11, 'highlights': ["The function 'is_numeric' is defined to test if a value is numeric, returning an int value for an integer and identifying non-numeric values. The function 'is_numeric' is defined to test if a value is numeric, returning an int value for an integer and identifying non-numeric values.", "The class 'question' is created to record a column number and value, with methods like 'match' and 'partition' to compare feature values and partition the dataset. The class 'question' is created to record a column number and value, with methods like 'match' and 'partition' to compare feature values and partition the dataset.", 'An example of partitioning the training dataset based on a specific condition is provided, assigning rows based on the condition. An example of partitioning the training dataset based on a specific condition is provided, assigning rows based on the condition.']}], 'duration': 230.748, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU2255406.jpg', 'highlights': ['The chapter introduces the process of building a decision tree classifier using Python, including initializing the training dataset, adding column labels, defining functions to find unique values and count the number of each type of example, with a sample dataset consisting of mango, grape, and lemon labels.', 'The sample dataset has rows representing examples, where the last column is the label and the first two columns are features, with an interesting fact that the second and fifth examples have almost the same features but different labels.', 'Functions are defined to find unique values for a column in the dataset and to count the number of each type of example, with a sample dataset containing unique labels of mango, grape, and lemon.', "The function 'is_numeric' is defined to test if a value is numeric, returning an int value for an integer and identifying non-numeric values.", "The class 'question' is created to record a column number and value, with methods like 'match' and 'partition' to compare feature values and partition the dataset.", 'An example of partitioning the training dataset based on a specific condition is provided, assigning rows based on the condition.']}, {'end': 2797.445, 'segs': [{'end': 2560.127, 'src': 'embed', 'start': 2488.195, 'weight': 0, 'content': [{'end': 2491.398, 'text': 'Next what we are doing here with defining a function as information gain.', 'start': 2488.195, 'duration': 3.203}, {'end': 2493.837, 'text': 'So what this information gain function?', 'start': 2492.057, 'duration': 1.78}, {'end': 2500.699, 'text': 'does it calculates the information gain using the uncertainty of the starting node, minus the weighted impurity of the child node?', 'start': 2493.837, 'duration': 6.862}, {'end': 2503.56, 'text': 'The next function is find the best split.', 'start': 2501.299, 'duration': 2.261}, {'end': 2513.922, 'text': 'Well, this function is used to find the best question to ask by iterating over every feature or value and then calculating the information gain for the detail explanation on the code.', 'start': 2504.06, 'duration': 9.862}, {'end': 2516.083, 'text': 'You can find the code in the description given below.', 'start': 2513.942, 'duration': 2.141}, {'end': 2520.184, 'text': 'All right next will define a class as leaf for classifying the data.', 'start': 2516.103, 'duration': 4.081}, {'end': 2527.152, 'text': 'It holds a dictionary of class like mango for how many times it appears in the row from the training data that reaches the sleeve.', 'start': 2520.931, 'duration': 6.221}, {'end': 2527.832, 'text': 'All right.', 'start': 2527.552, 'duration': 0.28}, {'end': 2529.573, 'text': 'Next is the decision node.', 'start': 2528.392, 'duration': 1.181}, {'end': 2532.453, 'text': 'So this decision node it will ask a question.', 'start': 2530.033, 'duration': 2.42}, {'end': 2537.254, 'text': 'This holds a reference to the question and the two child nodes on the base of it.', 'start': 2532.993, 'duration': 4.261}, {'end': 2540.254, 'text': 'You are deciding which node to add further to which branch.', 'start': 2537.294, 'duration': 2.96}, {'end': 2541.015, 'text': 'All right.', 'start': 2540.774, 'duration': 0.241}, {'end': 2546.615, 'text': 'So next what we are doing we are defining a function of build tree and inside that we are passing our number of rows.', 'start': 2541.355, 'duration': 5.26}, {'end': 2549.416, 'text': 'So this is the function that is used to build a tree.', 'start': 2547.096, 'duration': 2.32}, {'end': 2554.885, 'text': 'So initially what we did we define all the various function that we will be using in order to build a tree.', 'start': 2550.103, 'duration': 4.782}, {'end': 2560.127, 'text': "So let's start by partitioning the data set for each unique attribute.", 'start': 2555.505, 'duration': 4.622}], 'summary': 'Defining functions for information gain, finding best split, classifying data, and building a decision tree.', 'duration': 71.932, 'max_score': 2488.195, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU2488195.jpg'}, {'end': 2733.543, 'src': 'embed', 'start': 2702.981, 'weight': 5, 'content': [{'end': 2706.724, 'text': "Okay, so this was all about the coding part now, let's conclude this session.", 'start': 2702.981, 'duration': 3.743}, {'end': 2712.368, 'text': "But before concluding, let me just show you one more thing, and there's a scikit-learn algorithm, cheat sheet,", 'start': 2706.784, 'duration': 5.584}, {'end': 2715.57, 'text': 'which explains you which algorithm you should use and when.', 'start': 2712.368, 'duration': 3.202}, {'end': 2717.492, 'text': "alright, it's built in a decision tree format.", 'start': 2715.57, 'duration': 1.922}, {'end': 2718.833, 'text': "Let's see how it is built.", 'start': 2717.652, 'duration': 1.181}, {'end': 2722.395, 'text': 'So first condition it will check whether you have 50 samples or not.', 'start': 2719.293, 'duration': 3.102}, {'end': 2728.5, 'text': 'If your samples are greater than 50, then it will move ahead if it is less than 50, then you need to collect more data.', 'start': 2722.816, 'duration': 5.684}, {'end': 2733.543, 'text': 'If your sample is greater than 50, then you have to decide whether you want to predict a category or not.', 'start': 2729.159, 'duration': 4.384}], 'summary': 'Exploring scikit-learn algorithm cheat sheet for decision making based on sample size and prediction requirements.', 'duration': 30.562, 'max_score': 2702.981, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU2702981.jpg'}], 'start': 2488.195, 'title': 'Decision tree functions and algorithm', 'summary': 'Covers functions for calculating information gain, finding the best split, classifying data, and decision nodes for iterating over features, values, and questions. it also introduces the process of building a decision tree algorithm, including functions for partitioning the dataset, calculating information gain, recursively building branches, and classifying test data, with a demonstration of a decision tree predicting fruit types based on attributes, and concludes with a summary of scikit-learn algorithm cheat sheet for decision trees.', 'chapters': [{'end': 2541.015, 'start': 2488.195, 'title': 'Decision tree functions and nodes', 'summary': 'Covers the functions for calculating information gain, finding the best split, classifying data, and decision nodes for iterating over features, values, and questions to build a decision tree.', 'duration': 52.82, 'highlights': ['The decision node holds a reference to a question and two child nodes to decide which branch to add further to, aiding in building the decision tree.', 'The find best split function iterates over every feature or value to calculate the information gain for building the decision tree.', 'The information gain function calculates the information gain using the uncertainty of the starting node minus the weighted impurity of the child node.']}, {'end': 2797.445, 'start': 2541.355, 'title': 'Decision tree algorithm', 'summary': 'Introduces the process of building a decision tree algorithm, including functions for partitioning the dataset, calculating information gain, recursively building branches, and classifying test data, resulting in a demonstration of a decision tree predicting fruit types based on attributes, and concludes with a summary of scikit-learn algorithm cheat sheet for decision trees.', 'duration': 256.09, 'highlights': ['The chapter introduces the process of building a decision tree algorithm, including functions for partitioning the dataset, calculating information gain, recursively building branches, and classifying test data. Multiple functions are defined for building the decision tree, such as partitioning the dataset for each unique attribute, calculating information gain, recursively building true and false branches, and classifying test data.', "A demonstration of a decision tree predicting fruit types based on attributes is presented, with a specific example of the decision-making process. The decision tree predicts fruit types based on attributes, such as predicting 'mango' and 'lemon' if the diameter is greater than or equal to 3 and the color is yellow, and predicting 'grape' if the diameter is not greater than or equal to 3.", 'The chapter concludes with a summary of scikit-learn algorithm cheat sheet for decision trees, covering conditions for sample size, category prediction, label data, quantity prediction, and dimensionality reduction problems. The scikit-learn algorithm cheat sheet summarizes conditions for sample size, category prediction, label data, quantity prediction, and dimensionality reduction problems, providing guidance for decision-making in algorithm selection.']}], 'duration': 309.25, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/qDcl-FRnwSU/pics/qDcl-FRnwSU2488195.jpg', 'highlights': ['The decision node holds a reference to a question and two child nodes to aid in building the decision tree.', 'The find best split function iterates over every feature or value to calculate the information gain.', 'The information gain function calculates the information gain using the uncertainty of the starting node minus the weighted impurity of the child node.', 'The chapter introduces the process of building a decision tree algorithm, including functions for partitioning the dataset, calculating information gain, recursively building branches, and classifying test data.', 'A demonstration of a decision tree predicting fruit types based on attributes is presented, with a specific example of the decision-making process.', 'The chapter concludes with a summary of scikit-learn algorithm cheat sheet for decision trees, covering conditions for sample size, category prediction, label data, quantity prediction, and dimensionality reduction problems.']}], 'highlights': ['Demonstrates the widespread use of machine learning in daily life.', 'Illustrates the practical application of classification in fraud detection.', 'Highlights the role of classification in predictive analysis and categorization.', 'Classification algorithm predicts fruit type based on attributes like taste, color, size, and weight.', 'Emphasizes the importance of training the machine with various approaches for predictive analytics.', 'Explains the concept of random forest building multiple decision trees for a more accurate and stable prediction.', 'Name bias may outperform complex models with small datasets due to its simplicity.', 'Explains the concept of decision trees using a real-life scenario of navigating through a phone menu system.', 'The importance of evaluating multiple algorithms to find the one that provides the best result for a given dataset is emphasized.', 'The computation of entropy for the entire dataset is demonstrated and used to determine the best attribute for the root node of the decision tree.', 'The chapter concludes with the computation of the information gain from the Outlook feature, resulting in a final information gain value of 0.247, which is a crucial metric in decision tree construction.', 'The chapter discusses the process of calculating the information gain for the Outlook feature in a decision tree, emphasizing the importance of this calculation in building a decision tree model.', 'The chapter introduces the process of building a decision tree classifier using Python, including initializing the training dataset, adding column labels, defining functions to find unique values and count the number of each type of example, with a sample dataset consisting of mango, grape, and lemon labels.', 'The decision node holds a reference to a question and two child nodes to aid in building the decision tree.', 'The chapter introduces the process of building a decision tree algorithm, including functions for partitioning the dataset, calculating information gain, recursively building branches, and classifying test data.']}