{"id":9349,"date":"2020-05-18T09:45:24","date_gmt":"2020-05-18T16:45:24","guid":{"rendered":"https:\/\/www.springboard.com\/?p=9349"},"modified":"2022-07-19T22:35:04","modified_gmt":"2022-07-20T05:35:04","slug":"lp-machine-learning-unsupervised-learning-supervised-learning","status":"publish","type":"post","link":"https:\/\/www.springboard.com\/blog\/data-science\/lp-machine-learning-unsupervised-learning-supervised-learning\/","title":{"rendered":"Classical Examples of Supervised vs. Unsupervised Learning in Machine Learning"},"content":{"rendered":"\n<p><span style=\"font-weight: 400;\">Like humans, machines are capable of learning in different ways. When it comes to machine learning, the most common learning strategies are supervised learning, unsupervised learning, and reinforcement learning. This post will focus on unsupervised learning and supervised learning algorithms, and provide typical examples of each.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-weight: 400;\"><strong>What Is Supervised Learning In Machine Learning?<\/strong><\/span><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">As the name indicates, supervised learning involves machine learning algorithms that learn under the presence of a supervisor.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Learning under supervision directly translates to being under guidance and learning from an entity that is in charge of providing feedback through this process. When training a machine, supervised learning refers to a category of methods in which we teach or train a machine learning algorithm using data, while guiding the algorithm model with labels associated with the data.\u00a0<\/span>However, it is essential for <a href=\"https:\/\/www.springboard.com\/blog\/data-science\/what-does-a-data-scientist-do\/\" data-type=\"post\" data-id=\"24427\">data scientists<\/a> and machine learning engineers to understand algorithm models and which ones should be applied in particular circumstances.<\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">As humans, we consume a lot of information, but often don&#8217;t notice these data points. When we see a photo of an animal, for example, we instantly know what the animal is based on our prior experience.&nbsp;<\/span><span style=\"font-weight: 400;\">But what happens when the learner doesn&#8217;t instantly recognize the animal?&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">When the learner makes a guess and predicts what the animal might be, we have the opportunity to objectively evaluate if the learner has given a correct answer or not. This is possible because we have the correct labels of input. <\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">From now on, we&#8217;ll be referring to the machine learning algorithm as \u201cthe model.\u201d Now, if the model gave a correct answer, then there is nothing for us to do. Our job is to correct the model when the output of the model is wrong. If this is the case, we need to make sure that the model makes necessary updates so that the next time a cat image is shown to the model, it can correctly identify the image.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">The formal supervised learning process involves input variables, which we call (X), and an output variable, which we call (Y). We use an algorithm to learn the mapping function from the input to the output. In simple mathematics, the output (Y) is a dependent variable of input (X) as illustrated by:<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Y = f(X)<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Here, our end goal is to try to approximate the mapping function (f), so that we can predict the output variables (Y) when we have new input data (X).<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2020\/05\/shutterstock_1453496747.jpg\" alt=\"supervised vs. unsupervised learning\" class=\"wp-image-9358\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Examples of Supervised Learning<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">Now that we\u2019ve covered supervised learning, it is time to look at classic examples of supervised learning algorithms.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">In supervised learning, our goal is to learn the mapping function (f), which refers to being able to understand how the input (X) should be matched with output (Y) using available data.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Here, the machine learning model learns to fit mapping between examples of input features with their associated labels. When models are trained with these examples, we can use them to make new predictions on unseen data. <\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">The predicted labels can be both numbers or categories. For instance, if we are predicting house prices, then the output is a number. In this case, the model is a regression model. If we are predicting if an email is spam or not, the output is a category and the model is a classification model.&nbsp;<\/span><\/p>\n\n\n\n<p><strong>Example: House prices<\/strong><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">One practical example of supervised learning problems is predicting house prices. How is this achieved?<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">First, we need data about the houses: square footage, number of rooms, features, whether a house has a garden or not, and so on. We then need to know the prices of these houses, i.e. the corresponding labels. By leveraging data coming from thousands of houses, their features and prices, we can now train a supervised machine learning model to predict a new house\u2019s price based on the examples observed by the model.&nbsp;<\/span><\/p>\n\n\n\n<p><strong>Example: Is it a cat or a dog?<\/strong><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Image classification is a popular problem in the computer vision field. Here, the goal is to predict what class an image belongs to. In this set of problems, we are interested in finding the class label of an image. More precisely: is the image of a car or a plane? A cat or a dog?<\/span><\/p>\n\n\n\n<p><strong>Example: How&#8217;s the weather today?<\/strong><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">One particularly interesting problem which requires considering a lot of different parameters is predicting weather conditions in a particular location. To make correct predictions for the weather, we need to take into account various parameters, including historical temperature data, precipitation, wind, humidity, and so on. <\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">This particularly interesting and challenging problem may require developing complex supervised models that include multiple tasks. Predicting today\u2019s temperature is a regression problem, where the output labels are continuous variables. By contrast, predicting whether it is going to snow or not tomorrow is a binary classification problem.<\/span><\/p>\n\n\n\n<p><em>Want to learn more? Check out our post on How an <a href=\"https:\/\/learn.springboard.com\/school-of-data\/white-paper\/how-a-machine-learning-algorithm-helped-make-hurricane-damage-assessments-safer-cheaper-and-more-effective\/\" target=\"_blank\" rel=\"noopener\">ML Algorithm<\/a> Helped Make Hurricane Damage Assessments Safer, Cheaper, and More Effective.<\/em><\/p>\n\n\n\n<p><strong>Example: Who are the unhappy customers?<\/strong><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Another great example of supervised learning is text classification problems. In this set of problems, the goal is to predict the class label of a given piece of text.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">One particularly popular topic in text classification is to predict the sentiment of a piece of text, like a tweet or a product review. This is widely used in the e-commerce industry to help companies to determine negative comments made by customers.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2020\/05\/shutterstock_1242489943.jpg\" alt=\"unsupervised vs. supervised learning\" class=\"wp-image-9360\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What Is Unsupervised Learning?<\/strong><\/h2>\n\n\n\n<p><span style=\"font-weight: 400;\">In supervised learning, the main idea is to learn under supervision, where the supervision signal is named as target value or label. In unsupervised learning, we lack this kind of signal. Therefore, we need to find our way without any supervision or guidance. This simply means that we are alone and need to figure out what is what by ourselves.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">However, we are not totally in the dark. We do this kind of learning every day. In unsupervised learning, even though we do not have any labels for data points, we do have the actual data points. This means we can draw references from observations in the input data.&nbsp;<\/span><\/p>\n\n\n<div class=\"bg-leaf-50 p-4 my-3\"><h4 class=\"fw-bold text-center\">Get To Know Other\tData Science Students<\/h4><div class=\"row row-cols-1 row-cols-lg-3\"><div class=\"col\"><div class=\"card success-story-card h-100 d-flex justify-content-between mb-0\"><div class=\"flex-grow-1 text-center\"><a class=\"d-inline-block rounded-circle\" href=\"\/success\/cassie-gong\" style=\"width:125px;height:125px;overflow:hidden\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/res.cloudinary.com\/springboard-images\/image\/upload\/v1629203193\/Student%20Success\/Cassie_Gong_125x125.png\" alt=\"Mengqin (Cassie) Gong\" style=\"object-fit:contain;max-width:170px;height:125px\" \/><\/a><p class=\"fw-bold mb-0\">Mengqin (Cassie) Gong<\/p><p class=\"text-muted lh-1\">Data Scientist at Whatsapp<\/p><\/div><div class=\"w-100 d-block d-md-none mt-3\"><\/div><p class=\"mb-0 mx-auto text-center\"><a class=\"btn btn-primary mx-auto\" href=\"\/success\/cassie-gong\">Read Story<\/a><\/p><\/div><\/div><div class=\"col d-none d-md-block\"><div class=\"card success-story-card h-100 d-flex justify-content-between mb-0\"><div class=\"flex-grow-1 text-center\"><a class=\"d-inline-block rounded-circle\" href=\"\/success\/jonathan-king\" style=\"width:125px;height:125px;overflow:hidden\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/res.cloudinary.com\/springboard-images\/image\/upload\/v1629203191\/Student%20Success\/Jonathan_King_125x125.png\" alt=\"Jonathan King\" style=\"object-fit:contain;max-width:170px;height:125px\" \/><\/a><p class=\"fw-bold mb-0\">Jonathan King<\/p><p class=\"text-muted lh-1\">Sr. Healthcare Analyst at IBM<\/p><\/div><p class=\"mb-0 mx-auto text-center\"><a class=\"btn btn-primary mx-auto\" href=\"\/success\/jonathan-king\">Read Story<\/a><\/p><\/div><\/div><div class=\"col d-none d-md-block\"><div class=\"card success-story-card h-100 d-flex justify-content-between mb-0\"><div class=\"flex-grow-1 text-center\"><a class=\"d-inline-block rounded-circle\" href=\"\/success\/melanie-hanna\" style=\"width:125px;height:125px;overflow:hidden\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/res.cloudinary.com\/springboard-images\/image\/upload\/v1629203193\/Student%20Success\/Melanie_Hanna_125x125.png\" alt=\"Melanie Hanna\" style=\"object-fit:contain;max-width:170px;height:125px\" \/><\/a><p class=\"fw-bold mb-0\">Melanie Hanna<\/p><p class=\"text-muted lh-1\">Data Scientist at Farmer's Fridge<\/p><\/div><p class=\"mb-0 mx-auto text-center\"><a class=\"btn btn-primary mx-auto\" href=\"\/success\/melanie-hanna\">Read Story<\/a><\/p><\/div><\/div><\/div><\/div>\n\n\n\n<p><span style=\"font-weight: 400;\">Imagine you are in a foreign country and you are visiting a food market, for example. You see a stall selling a fruit that you cannot identify. You don&#8217;t know the name of this fruit. However, you have your observations to rely on, and you can use these as a reference. In this case, you can easily the fruit apart from nearby vegetables or other food by identifying its various features like its shape, color, or size.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">This is roughly how unsupervised learning happens. We use the data points as references to find meaningful structure and patterns in the observations. Unsupervised learning is commonly used for finding meaningful patterns and groupings inherent in data, extracting generative features, and exploratory purposes.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Examples of Unsupervised Learning<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400;\">There are a few different types of unsupervised learning. We&#8217;ll review three common approaches below.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\"><strong>Example: Finding customer segments<\/strong><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Clustering is an unsupervised technique where the goal is to find natural groups or clusters in a feature space and interpret the input data. There are many different clustering algorithms in the field of <a href=\"https:\/\/www.springboard.com\/blog\/data-science\/data-science-definition\/\">data science<\/a>. One common approach is to divide the data points in a way that each data point falls into a group that is similar to other data points in the same group based on a predefined similarity or distance metric in the feature space.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Clustering is commonly used for determining customer segments in marketing data. Being able to determine different segments of customers helps marketing teams approach these customer segments in unique ways. (Think of features like gender, location, age, education, income bracket, and so on.)<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.springboard.com\/blog\/wp-content\/uploads\/2020\/05\/shutterstock_272900735.jpg\" alt=\"machine learning springboard\" class=\"wp-image-9363\"\/><\/figure>\n\n\n\n<p><span style=\"font-weight: 400;\"><strong>Example: Reducing the complexity of a problem<\/strong><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Dimensionality reduction is a commonly used unsupervised learning technique where the goal is to reduce the number of random variables under consideration. It has several practical applications. One of the most common uses of dimensionality reduction is to reduce the complexity of a problem by projecting the feature space to a lower-dimensional space so that less correlated variables are considered in a machine learning system.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">The most common approaches used in dimensionality reduction are PCA, t-SNE, and UMAP algorithms. They are especially useful for reducing the complexity of a problem and also visualizing the data instances in a better way. Before going into more detail about feature projection, let&#8217;s look at another important concept in machine learning: feature selection.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\"><strong>Example: Feature selection<\/strong><\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Even though feature selection and dimensionality reduction aim toward reducing the number of features in the original set of features, understanding how feature selection works helps us get a better understanding of dimensionality reduction.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Assume that we want to predict how capable an applicant is of repaying a loan from the perspective of a bank. Here, we need to help the bank set up a machine learning system so that each loan can be given to applicants who can repay the loan. We need a lot of information about each application to make predictions. A few important attributes about applicants are the applicant&#8217;s average monthly income, debt, credit history, and so on.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">Typically, however, banks collect much more information from applicants when taking their applications. Not all of it is relevant for predicting an applicant&#8217;s credit risk score. For instance, does an applicant&#8217;s age make any difference when deciding whether the applicant can repay the loan? Is the applicant\u2019s gender important for determining the credit risk score? Probably not.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">It is important to understand that not every feature adds value to solving the problem. Therefore, eliminating these features is an essential part of machine learning. In feature selection, we try to eliminate a subset of the original set of features.&nbsp;<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400;\">In dimensionality reduction, we still discard features but do that in a way that the feature space is projected onto a smaller feature space, therefore eliminating less important information during this process.<\/span><\/p>\n\n\n\n<p class=\"rm has-background\" style=\"background-color:#efeff6\"><strong>Since you\u2019re here\u2026<br><\/strong>Curious about a career in data science? Experiment with our <a rel=\"noreferrer noopener\" href=\"https:\/\/www.springboard.com\/resources\/guides\/data-science-process\/\" target=\"_blank\">free data science learning path<\/a>, or join our <a rel=\"noreferrer noopener\" href=\"https:\/\/www.springboard.com\/courses\/data-science-career-track\/\" target=\"_blank\">Data Science Bootcamp<\/a>, where you\u2019ll get your tuition back if you don&#8217;t land a job after graduating. We\u2019re confident because our courses work \u2013 check out our <a rel=\"noreferrer noopener\" href=\"https:\/\/www.springboard.com\/success\/\" target=\"_blank\">student success stories<\/a> to get inspired.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Like humans, machines are capable of learning in different ways. When it comes to machine learning, the most common learning strategies are supervised learning, unsupervised learning, and reinforcement learning. This post will focus on unsupervised learning and supervised learning algorithms, and provide typical examples of each. What Is Supervised Learning In Machine Learning? As the [&hellip;]<\/p>\n","protected":false},"author":92,"featured_media":9355,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_eb_attr":"","_eb_data_table":"","footnotes":""},"categories":[67],"tags":[],"marketing_tags":[],"class_list":{"0":"post-9349","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-science"},"acf":[],"_links":{"self":[{"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/posts\/9349"}],"collection":[{"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/users\/92"}],"replies":[{"embeddable":true,"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/comments?post=9349"}],"version-history":[{"count":4,"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/posts\/9349\/revisions"}],"predecessor-version":[{"id":27610,"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/posts\/9349\/revisions\/27610"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/media\/9355"}],"wp:attachment":[{"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/media?parent=9349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/categories?post=9349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/tags?post=9349"},{"taxonomy":"marketing_tags","embeddable":true,"href":"https:\/\/www.springboard.com\/blog\/wp-json\/wp\/v2\/marketing_tags?post=9349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}