1.4 Machine Learning Overview | Supervised learning part 1 --[Machine Learning | Andrew Ng]
 Machine learning is creating tremendous economic value today. I think 99% of the economic value created by machine learning today is through one type of machine learning, which is called supervised learning. Let's take a look at what that means. Supervised machine learning, or more commonly supervised learning, refers to algorithms that learn x to y or input to output mappings. The key characteristic of supervised learning is that you give your learning algorithm examples to learn from that include the right answers, where by right answer I mean the correct label y for a given input x. And it's by seeing correct pairs of input x and desired output label y that the learning algorithm eventually learns to take just the input alone without the output label and gives a reasonably accurate prediction or guess of the output. Let's look at some examples. If the input x is an email and the output y is this email spam or not spam, this gives you your spam filter. Or if the input is an audio clip and the algorithm's job is to output the text transcript, then this is speech recognition. Or if you want to input English and have it output the corresponding Spanish, Arabic, Hindi, Chinese, Japanese or something else translation, then that's machine translation. Or the most lucrative form of supervised learning today is probably used in online advertising. Nearly all the large online ad platforms have a learning algorithm that inputs some information about an ad and some information about you and then tries to figure out if you will click on that ad or not. Because by showing you ads that you're slightly more likely to click on for these large online ad platforms, every click is revenue. This actually drives a lot of revenue for these companies. This is something that one's done a lot of work on, maybe not the most inspiring application, but it certainly has a significant economic impact in some companies today. Or if you want to build a self-driving car, the learning algorithm would take as input an image and some information from other sensors, such as a radar or other things, and then try to output the position of say other cars so that your self-driving car can safely drive around the other cars. Or take manufacturing. I've actually done a lot of work in this sector at Landing AI. You can have a learning algorithm take as input a picture of a manufactured product, say a cell phone that just rolled off the production line, and have the learning algorithm output whether or not there is a scratch, dent, or other defect in the product. This is called visual inspection and is helping manufacturers reduce or prevent defects in their products. In all of these applications, you would first train your model with examples of InputsX and the right answers, that is, the labels Y. After the model has learned from these Input Outputs or X and Y pairs, it can then take a brand new Input X, something it's never seen before, and try to produce the appropriate corresponding output Y. Let's dive more deeply into one specific example. Say you want to predict housing prices based on the size of a house. You've collected some data and say you plot the data and it looks like this. Here on the horizontal axis is the size of the house in square feet. And yes, I live in the United States where we still use square feet. I know most of the world uses square meters. And here on the vertical axis is the price of the house in, say, thousands of dollars. So with this data, let's say a friend wants to know what's the price for their 750 square foot house. How can a learning algorithm help you? One thing a learning algorithm might be able to do is say, fit a straight line to the data and reading off the straight line, it looks like your friend's house could be sold for maybe about, I don't know, $150,000. But fitting a straight line isn't the only learning algorithm you can use. There are others that could work better for this application. For example, rather than fitting a straight line, you might decide that it's better to fit a curve, a function that's slightly more complicated or more complex than a straight line. If you do that and make a prediction here, then it looks like, well, your friend's house could be sold for closer to $200,000. One of the things you see later in this class is how you can decide whether to fit a straight line, a curve, or another function that is even more complex to the data. Now, it doesn't seem appropriate to pick the one that gives your friend the best price, but one thing you see is how to get an algorithm to systematically choose the most appropriate line or curve or other thing to fit to this data. What you're seeing in this slide is an example of supervised learning. This is the algorithm or data set in which the so-called right answer, that is, the label or the correct price y is given for every house on the plot. And the task of the learning algorithm is to produce more of these right answers, specifically predicting what is the likely price for other houses like your friend's house. That's why this is supervised learning. To define a little bit more terminology, this housing price prediction is a particular type of supervised learning called regression. And by regression, I mean we're trying to predict a number from infinitely many possible numbers such as the house prices in our example, which could be 150,000 or 70,000 or 183,000 or any other number in between. So that's supervised learning, learning input-output or x-to-y mappings. And you saw in this video an example of regression where the task is to predict a number. But there's also a second major type of supervised learning problem called classification. Let's take a look at what that means in the next video.
[{"start": 0.0, "end": 5.84, "text": " Machine learning is creating tremendous economic value today."}, {"start": 5.84, "end": 11.08, "text": " I think 99% of the economic value created by machine learning today is through one type"}, {"start": 11.08, "end": 13.92, "text": " of machine learning, which is called supervised learning."}, {"start": 13.92, "end": 17.8, "text": " Let's take a look at what that means."}, {"start": 17.8, "end": 22.76, "text": " Supervised machine learning, or more commonly supervised learning, refers to algorithms"}, {"start": 22.76, "end": 28.98, "text": " that learn x to y or input to output mappings."}, {"start": 28.98, "end": 35.72, "text": " The key characteristic of supervised learning is that you give your learning algorithm examples"}, {"start": 35.72, "end": 42.72, "text": " to learn from that include the right answers, where by right answer I mean the correct label"}, {"start": 42.72, "end": 46.0, "text": " y for a given input x."}, {"start": 46.0, "end": 53.28, "text": " And it's by seeing correct pairs of input x and desired output label y that the learning"}, {"start": 53.28, "end": 58.96, "text": " algorithm eventually learns to take just the input alone without the output label and gives"}, {"start": 58.96, "end": 63.92, "text": " a reasonably accurate prediction or guess of the output."}, {"start": 63.92, "end": 66.6, "text": " Let's look at some examples."}, {"start": 66.6, "end": 74.64, "text": " If the input x is an email and the output y is this email spam or not spam, this gives"}, {"start": 74.64, "end": 77.84, "text": " you your spam filter."}, {"start": 77.84, "end": 87.02000000000001, "text": " Or if the input is an audio clip and the algorithm's job is to output the text transcript, then"}, {"start": 87.02, "end": 90.47999999999999, "text": " this is speech recognition."}, {"start": 90.47999999999999, "end": 96.19999999999999, "text": " Or if you want to input English and have it output the corresponding Spanish, Arabic,"}, {"start": 96.19999999999999, "end": 103.47999999999999, "text": " Hindi, Chinese, Japanese or something else translation, then that's machine translation."}, {"start": 103.47999999999999, "end": 111.0, "text": " Or the most lucrative form of supervised learning today is probably used in online advertising."}, {"start": 111.0, "end": 116.56, "text": " Nearly all the large online ad platforms have a learning algorithm that inputs some information"}, {"start": 116.56, "end": 122.62, "text": " about an ad and some information about you and then tries to figure out if you will click"}, {"start": 122.62, "end": 124.8, "text": " on that ad or not."}, {"start": 124.8, "end": 129.16, "text": " Because by showing you ads that you're slightly more likely to click on for these large online"}, {"start": 129.16, "end": 132.32, "text": " ad platforms, every click is revenue."}, {"start": 132.32, "end": 135.76, "text": " This actually drives a lot of revenue for these companies."}, {"start": 135.76, "end": 140.88, "text": " This is something that one's done a lot of work on, maybe not the most inspiring application,"}, {"start": 140.88, "end": 145.8, "text": " but it certainly has a significant economic impact in some companies today."}, {"start": 145.8, "end": 151.16000000000003, "text": " Or if you want to build a self-driving car, the learning algorithm would take as input"}, {"start": 151.16000000000003, "end": 157.64000000000001, "text": " an image and some information from other sensors, such as a radar or other things, and then"}, {"start": 157.64000000000001, "end": 163.64000000000001, "text": " try to output the position of say other cars so that your self-driving car can safely drive"}, {"start": 163.64000000000001, "end": 165.9, "text": " around the other cars."}, {"start": 165.9, "end": 167.92000000000002, "text": " Or take manufacturing."}, {"start": 167.92000000000002, "end": 172.5, "text": " I've actually done a lot of work in this sector at Landing AI."}, {"start": 172.5, "end": 177.88, "text": " You can have a learning algorithm take as input a picture of a manufactured product,"}, {"start": 177.88, "end": 183.0, "text": " say a cell phone that just rolled off the production line, and have the learning algorithm"}, {"start": 183.0, "end": 189.2, "text": " output whether or not there is a scratch, dent, or other defect in the product."}, {"start": 189.2, "end": 194.08, "text": " This is called visual inspection and is helping manufacturers reduce or prevent defects in"}, {"start": 194.08, "end": 196.2, "text": " their products."}, {"start": 196.2, "end": 202.2, "text": " In all of these applications, you would first train your model with examples of InputsX"}, {"start": 202.2, "end": 206.11999999999998, "text": " and the right answers, that is, the labels Y."}, {"start": 206.11999999999998, "end": 211.64, "text": " After the model has learned from these Input Outputs or X and Y pairs, it can then take"}, {"start": 211.64, "end": 216.92, "text": " a brand new Input X, something it's never seen before, and try to produce the appropriate"}, {"start": 216.92, "end": 221.0, "text": " corresponding output Y."}, {"start": 221.0, "end": 225.28, "text": " Let's dive more deeply into one specific example."}, {"start": 225.28, "end": 230.35999999999999, "text": " Say you want to predict housing prices based on the size of a house."}, {"start": 230.36, "end": 236.04000000000002, "text": " You've collected some data and say you plot the data and it looks like this."}, {"start": 236.04000000000002, "end": 240.20000000000002, "text": " Here on the horizontal axis is the size of the house in square feet."}, {"start": 240.20000000000002, "end": 243.24, "text": " And yes, I live in the United States where we still use square feet."}, {"start": 243.24, "end": 247.08, "text": " I know most of the world uses square meters."}, {"start": 247.08, "end": 253.48000000000002, "text": " And here on the vertical axis is the price of the house in, say, thousands of dollars."}, {"start": 253.48000000000002, "end": 260.12, "text": " So with this data, let's say a friend wants to know what's the price for their 750 square"}, {"start": 260.12, "end": 261.64, "text": " foot house."}, {"start": 261.64, "end": 264.24, "text": " How can a learning algorithm help you?"}, {"start": 264.24, "end": 269.88, "text": " One thing a learning algorithm might be able to do is say, fit a straight line to the data"}, {"start": 269.88, "end": 274.4, "text": " and reading off the straight line, it looks like your friend's house could be sold for"}, {"start": 274.4, "end": 279.4, "text": " maybe about, I don't know, $150,000."}, {"start": 279.4, "end": 283.24, "text": " But fitting a straight line isn't the only learning algorithm you can use."}, {"start": 283.24, "end": 286.84000000000003, "text": " There are others that could work better for this application."}, {"start": 286.84, "end": 291.52, "text": " For example, rather than fitting a straight line, you might decide that it's better to"}, {"start": 291.52, "end": 297.23999999999995, "text": " fit a curve, a function that's slightly more complicated or more complex than a straight"}, {"start": 297.23999999999995, "end": 298.23999999999995, "text": " line."}, {"start": 298.23999999999995, "end": 303.96, "text": " If you do that and make a prediction here, then it looks like, well, your friend's house"}, {"start": 303.96, "end": 308.55999999999995, "text": " could be sold for closer to $200,000."}, {"start": 308.55999999999995, "end": 313.84, "text": " One of the things you see later in this class is how you can decide whether to fit a straight"}, {"start": 313.84, "end": 320.44, "text": " line, a curve, or another function that is even more complex to the data."}, {"start": 320.44, "end": 325.88, "text": " Now, it doesn't seem appropriate to pick the one that gives your friend the best price,"}, {"start": 325.88, "end": 332.0, "text": " but one thing you see is how to get an algorithm to systematically choose the most appropriate"}, {"start": 332.0, "end": 337.35999999999996, "text": " line or curve or other thing to fit to this data."}, {"start": 337.35999999999996, "end": 342.0, "text": " What you're seeing in this slide is an example of supervised learning."}, {"start": 342.0, "end": 347.92, "text": " This is the algorithm or data set in which the so-called right answer, that is, the label"}, {"start": 347.92, "end": 352.72, "text": " or the correct price y is given for every house on the plot."}, {"start": 352.72, "end": 358.64, "text": " And the task of the learning algorithm is to produce more of these right answers, specifically"}, {"start": 358.64, "end": 364.12, "text": " predicting what is the likely price for other houses like your friend's house."}, {"start": 364.12, "end": 366.92, "text": " That's why this is supervised learning."}, {"start": 366.92, "end": 371.8, "text": " To define a little bit more terminology, this housing price prediction is a particular type"}, {"start": 371.8, "end": 375.0, "text": " of supervised learning called regression."}, {"start": 375.0, "end": 380.56, "text": " And by regression, I mean we're trying to predict a number from infinitely many possible"}, {"start": 380.56, "end": 391.16, "text": " numbers such as the house prices in our example, which could be 150,000 or 70,000 or 183,000"}, {"start": 391.16, "end": 394.16, "text": " or any other number in between."}, {"start": 394.16, "end": 399.96000000000004, "text": " So that's supervised learning, learning input-output or x-to-y mappings."}, {"start": 399.96, "end": 406.32, "text": " And you saw in this video an example of regression where the task is to predict a number."}, {"start": 406.32, "end": 412.64, "text": " But there's also a second major type of supervised learning problem called classification."}, {"start": 412.64, "end": 430.24, "text": " Let's take a look at what that means in the next video."}]