Hi. In the previous video, we defined and described machine learning with an example related to predicting whether or not it's going to rain on a given day. In this video, we'll stick with that example to define supervised learning and unsupervised learning. Recall from the previous video that machine learning is centered around the idea of computers learning to perform tasks without being explicitly programmed to do so. We were talking about using machine learning to predict whether or not it's going to rain. This is an example of what we call supervised machine learning. A very common subset of machine learning that's used in practice pretty frequently. Supervised machine learning, which is commonly referred to as just simply supervised learning, is when an algorithm is learning a function then maps a collection of inputs to an output based on example pairs of inputs and output, which we refer to as our training data. In a way, our algorithm is being supervised by certain truth values for the function output. In this case, our rain problem is a supervised learning problem because we're trying to use an algorithm to map inputs of cloud coverage and humidity levels to the probability that it's going to rain. Our supervising truth is whether or not it rained on each day within our training data. These truth values, also known as labels, are the key behind supervised learning. We cannot do supervised learning without these supervising labels, because they're supervising our machine learning algorithm. There are plenty of other examples of supervised learning. We could try to predict how much it's going to rain. This is different than the probability of it raining at all, but it still contains labels to supervise the algorithms learning process. Those labels are the amount that it rained on previous days instead of just whether or not it did rain. Thinking back to our supply chain example, predicting when a specific item might go out of stock is also a supervised learning problem. When items have gone out of stock in the past, could serve as supervising labels. Predicting whether or not a medical treatment will be effective for a particular patient is another example, and estimating how many votes a political candidate might get in an election year is yet another. Overall, it's a good rule of thumb that if the word's estimate or predict are involved in the data science questionnaire design. It's a supervised learning problem and task. You might be wondering, what if we don't have labels to supervise our learning? What if we aren't trying to estimate or predict something as part of our question or design? The opposite of supervised machine learning is unsupervised machine learning. Many data science students wonder, how do we do machine learning if we don't have any labels on which to train our algorithm? That's a good question. Unsupervised learning is a completely different problem set. It's a type of machine learning that looks to understand relationships between inputs without any preexisting labels. So unsupervised algorithms are not being supervised by some label, they're not trying to predict anything and they're not trying to estimate anything. Instead, they're trying to understand how features, or columns, and records, or rows are related to one another. What would an example of unsupervised learning look like? Let's stick with our weather domain. Instead of trying to predict whether or not it's going to rain, we might try to group days together if they have similar weather. We can use an unsupervised learning algorithm to group these days together based on their features. Cloud coverage, humidity level, and whether or not it rained, which we can now use as a feature rather than labels in our unsupervised learning problem. Days that are clear and dry might be grouped together. Days that are cloudy and dry might be grouped together, and days that are cloudy and rainy might be grouped together. This can be useful because we can look at the days in each group and then label those groups ourselves based on their average of weather. Some days might be sunny, some days might be overcast, and some days might be raining, or there might be some other type of weather pattern based on the patterns identified in our unsupervised learning process. Other examples of unsupervised learning in the real world, group customers together based on their purchasing habits, group patients together based on their health conditions, and identify transactions that might be fraudulent because they're so dissimilar from other transactions. Unsupervised learning can be especially helpful when data labels aren't available or we're trying to learn more about our data and its relationships. You will probably see this a lot during the exploratory data analysis phase of a data science project. Being able to frame real-world problems into supervised learning and unsupervised learning problems opens up a world of possibilities for applying machine learning to data science projects. Instead of just testing aggregated data with hypothesis tests, we can now predict, estimate, group, and find relationships using our data. Throughout the rest of this lesson, we'll dig down deeper into supervised learning and unsupervised learning before we move on to learning how to apply them in the next module. But first, we have a brief knowledge check for you to make sure you are grasping the key points so far.