CHANNEL_NAME
stringclasses
1 value
URL
stringlengths
43
43
TITLE
stringlengths
61
100
DESCRIPTION
stringclasses
6 values
TRANSCRIPTION
stringlengths
2.07k
14.5k
SEGMENTS
stringlengths
3.72k
25k
Machine Learning Specialization 2022 -- Andrew Ng, Stanford University.
https://www.youtube.com/watch?v=y8JgiWcUnU8
1.1 Machine Learning Overview | Welcome to machine learning!--[Machine Learning | Andrew Ng]
First Course: Supervised Machine Learning : Regression and Classification. If you liked the content please subscribe and put a little blue thumb. Take heart!
Welcome to machine learning. What is machine learning? You probably use it many times a day without even knowing it. Anytime you want to find out something like, how do I make a sushi roll, you can do a web search on Google, Bing, or Baidu to find out. And that works so well because their machine learning software has figured out how to rank web pages. Or when you upload pictures to Instagram or Snapchat and think to yourself, I want to tag my friends so they can see their pictures. Well these apps can recognize your friends in your pictures and label them as well. That's also machine learning. Or if you've just finished watching a Star Wars movie on the video streaming service and you think, what other similar movies could I watch? Well the streaming service will likely use machine learning to recommend something that you might like. Each time you use voice-to-text on your phone to write a text message, hey Andrew, how's it going? Or tell your phone, hey Siri, play a song by Rihanna. Or ask your other phone, okay Google, show me Indian restaurants near me. That's also machine learning. Each time you receive an email titled, congratulations, you've won a million dollars. Well maybe you're rich, congratulations. Or more likely your email service will probably flag it as spam. Snapchat too is an application of machine learning. Beyond consumer applications that you might use, AI is also rapidly making its way into big companies and into industrial applications. For example, I'm deeply concerned about climate change and I'm glad to see that machine learning is already hoping to optimize wind turbine power generation. Or in healthcare, it's starting to make its way into hospitals to help doctors make accurate diagnoses. Or recently, at Landing AI, I've been doing a lot of work putting computer vision into factories to help inspect if something coming off the assembly line has any defects. That's machine learning. It's a science of getting computers to learn without being explicitly programmed. In this class, you learn about machine learning and get to implement machine learning in code yourself. Hundreds of others have taken the earlier version of this course, which is a course that led to the founding of Coursera. And many learners ended up building exciting machine learning systems or even pursuing very successful careers in AI. I'm excited that you're on this journey with me. Welcome and let's get started.
[{"start": 0.0, "end": 6.04, "text": " Welcome to machine learning."}, {"start": 6.04, "end": 8.16, "text": " What is machine learning?"}, {"start": 8.16, "end": 12.280000000000001, "text": " You probably use it many times a day without even knowing it."}, {"start": 12.280000000000001, "end": 17.16, "text": " Anytime you want to find out something like, how do I make a sushi roll, you can do a web"}, {"start": 17.16, "end": 21.080000000000002, "text": " search on Google, Bing, or Baidu to find out."}, {"start": 21.080000000000002, "end": 25.76, "text": " And that works so well because their machine learning software has figured out how to rank"}, {"start": 25.76, "end": 27.76, "text": " web pages."}, {"start": 27.76, "end": 32.44, "text": " Or when you upload pictures to Instagram or Snapchat and think to yourself, I want to"}, {"start": 32.44, "end": 35.480000000000004, "text": " tag my friends so they can see their pictures."}, {"start": 35.480000000000004, "end": 40.480000000000004, "text": " Well these apps can recognize your friends in your pictures and label them as well."}, {"start": 40.480000000000004, "end": 43.160000000000004, "text": " That's also machine learning."}, {"start": 43.160000000000004, "end": 47.480000000000004, "text": " Or if you've just finished watching a Star Wars movie on the video streaming service"}, {"start": 47.480000000000004, "end": 50.96, "text": " and you think, what other similar movies could I watch?"}, {"start": 50.96, "end": 55.24, "text": " Well the streaming service will likely use machine learning to recommend something that"}, {"start": 55.24, "end": 56.72, "text": " you might like."}, {"start": 56.72, "end": 61.64, "text": " Each time you use voice-to-text on your phone to write a text message, hey Andrew, how's"}, {"start": 61.64, "end": 62.64, "text": " it going?"}, {"start": 62.64, "end": 66.03999999999999, "text": " Or tell your phone, hey Siri, play a song by Rihanna."}, {"start": 66.03999999999999, "end": 71.92, "text": " Or ask your other phone, okay Google, show me Indian restaurants near me."}, {"start": 71.92, "end": 73.92, "text": " That's also machine learning."}, {"start": 73.92, "end": 79.32, "text": " Each time you receive an email titled, congratulations, you've won a million dollars."}, {"start": 79.32, "end": 81.44, "text": " Well maybe you're rich, congratulations."}, {"start": 81.44, "end": 86.24, "text": " Or more likely your email service will probably flag it as spam."}, {"start": 86.24, "end": 89.88, "text": " Snapchat too is an application of machine learning."}, {"start": 89.88, "end": 95.11999999999999, "text": " Beyond consumer applications that you might use, AI is also rapidly making its way into"}, {"start": 95.11999999999999, "end": 99.0, "text": " big companies and into industrial applications."}, {"start": 99.0, "end": 105.32, "text": " For example, I'm deeply concerned about climate change and I'm glad to see that machine learning"}, {"start": 105.32, "end": 110.28, "text": " is already hoping to optimize wind turbine power generation."}, {"start": 110.28, "end": 115.75999999999999, "text": " Or in healthcare, it's starting to make its way into hospitals to help doctors make accurate"}, {"start": 115.76, "end": 116.76, "text": " diagnoses."}, {"start": 116.76, "end": 122.52000000000001, "text": " Or recently, at Landing AI, I've been doing a lot of work putting computer vision into"}, {"start": 122.52000000000001, "end": 129.6, "text": " factories to help inspect if something coming off the assembly line has any defects."}, {"start": 129.6, "end": 131.52, "text": " That's machine learning."}, {"start": 131.52, "end": 137.20000000000002, "text": " It's a science of getting computers to learn without being explicitly programmed."}, {"start": 137.20000000000002, "end": 142.44, "text": " In this class, you learn about machine learning and get to implement machine learning in code"}, {"start": 142.44, "end": 144.52, "text": " yourself."}, {"start": 144.52, "end": 148.32000000000002, "text": " Hundreds of others have taken the earlier version of this course, which is a course"}, {"start": 148.32000000000002, "end": 150.88000000000002, "text": " that led to the founding of Coursera."}, {"start": 150.88000000000002, "end": 155.84, "text": " And many learners ended up building exciting machine learning systems or even pursuing"}, {"start": 155.84, "end": 158.4, "text": " very successful careers in AI."}, {"start": 158.4, "end": 161.32000000000002, "text": " I'm excited that you're on this journey with me."}, {"start": 161.32, "end": 174.84, "text": " Welcome and let's get started."}]
Machine Learning Specialization 2022 -- Andrew Ng, Stanford University.
https://www.youtube.com/watch?v=AISftYVyS50
1.2 Machine Learning Overview | What is machine learning? --[Machine Learning | Andrew Ng]
First Course: Supervised Machine Learning : Regression and Classification. If you liked the content please subscribe and put a little blue thumb. Take heart!
So, what is machine learning? In this video you learn the definition of what it is, and also get a sense of when you might want to apply it. Let's take a look together. Here's the definition of what is machine learning that is attributed to Arthur Samuel. He defined machine learning as the feeble study that gives computers the ability to learn without being explicitly programmed. Arthur's claim to fame was that back in the 1950s he wrote a checkers playing program. And the amazing thing about this program was that Arthur Samuel himself wasn't a very good checkers player. What he did was he had programmed a computer to play maybe tens of thousands of games against itself. And by watching what sorts of board positions tend to lead to wins, and what positions tend to lead to losses, the checkers playing program learned over time what a good or bad board position is. By trying to get to good and avoid bad positions, his program learned to get better and better at playing checkers. Because the computer had the patience to play tens of thousands of games against itself, it was able to get so much checkers playing experience that eventually it became a better checkers player than Arthur Samuel himself. Now throughout these videos, besides me trying to talk about stuff, I'll occasionally ask you a question to help make sure you understand the content. Here's one about what happens if the computer had played far fewer games. Please take a look and pick whichever you think is a better answer. Thanks for looking at the quiz. And so if you had selected this answer, whether made it worse, then you got it right. In general, the more opportunities you give a learning algorithm to learn, the better it will perform. If you didn't select the correct answer the first time, that's totally okay too. The point of these quiz questions isn't to see if you can get them all correct on the first try. These questions are here just to help you practice the concepts you're learning. Arthur Samuel's definition was a rather informal one. But in the next two videos, we'll dive deeper together into what are the major types of machine learning algorithms. In this class, you learn about many different learning algorithms. The two main types of machine learning are supervised learning and unsupervised learning. We'll define what these terms mean more in the next couple videos. Of these two, supervised learning is the type of machine learning that is used most in many real world applications and that has seen the most rapid advancement and innovation. In this specialization, which has three causes in total, the first and second causes will focus on supervised learning and the third will focus on unsupervised learning, recommender systems and reinforcement learning. By far, the most used types of learning algorithms today are supervised learning, unsupervised learning and recommender systems. The other thing we're going to spend a lot of time on in this specialization is practical advice for applying learning algorithms. This is something I feel pretty strongly about. Teaching about learning algorithms is like giving someone a set of tools and equally important or even more important than making sure you have great tools is making sure you know how to apply them. Because you know, what good is it if someone were to give you a state of the art hammer or a state of the art hand drill and say, good luck, now you have all the tools you need to build a three story house. It doesn't really work like that. And so too in machine learning, making sure you have the tools is really important. And so it's making sure that you know how to apply the tools of machine learning effectively. So that's what you get in this class, the tools as well as the skills of applying them effectively. I regularly visit with friends and teams in some of the top tech companies. And even today, I see experienced machine learning teams apply machine learning algorithms to some problems. And sometimes they've been going at it for six months without much success. And when I look at what they're doing, I sometimes feel like I could have told them six months ago that the current approach won't work. And there's a different way of using these tools that will give them a much better chance of success. So in this class, one of the relatively unique things you learn is you learn a lot about the best practices for how to actually develop a practical, valuable machine learning system. This way, you're less likely to end up in one of those teams that end up losing six months going in the wrong direction. In this class, you gain a sense of how the most skilled machine learning engineers build systems. I hope you finish this class as one of those very rare people in today's world that know how to design and build serious machine learning systems. So that's machine learning. In the next video, let's look more deeply at what is supervised learning and also what is unsupervised learning. In addition, you learn when you might want to use each of them, supervised and unsupervised learning. I'll see you in the next video.
[{"start": 0.0, "end": 3.0, "text": " So, what is machine learning?"}, {"start": 3.0, "end": 8.08, "text": " In this video you learn the definition of what it is, and also get a sense of when you might"}, {"start": 8.08, "end": 9.08, "text": " want to apply it."}, {"start": 9.08, "end": 10.68, "text": " Let's take a look together."}, {"start": 10.68, "end": 17.44, "text": " Here's the definition of what is machine learning that is attributed to Arthur Samuel."}, {"start": 17.44, "end": 21.48, "text": " He defined machine learning as the feeble study that gives computers the ability to"}, {"start": 21.48, "end": 25.080000000000002, "text": " learn without being explicitly programmed."}, {"start": 25.08, "end": 30.919999999999998, "text": " Arthur's claim to fame was that back in the 1950s he wrote a checkers playing program."}, {"start": 30.919999999999998, "end": 36.04, "text": " And the amazing thing about this program was that Arthur Samuel himself wasn't a very good"}, {"start": 36.04, "end": 38.2, "text": " checkers player."}, {"start": 38.2, "end": 43.32, "text": " What he did was he had programmed a computer to play maybe tens of thousands of games against"}, {"start": 43.32, "end": 44.4, "text": " itself."}, {"start": 44.4, "end": 49.04, "text": " And by watching what sorts of board positions tend to lead to wins, and what positions tend"}, {"start": 49.04, "end": 54.76, "text": " to lead to losses, the checkers playing program learned over time what a good or bad board"}, {"start": 54.76, "end": 56.16, "text": " position is."}, {"start": 56.16, "end": 62.0, "text": " By trying to get to good and avoid bad positions, his program learned to get better and better"}, {"start": 62.0, "end": 64.08, "text": " at playing checkers."}, {"start": 64.08, "end": 68.12, "text": " Because the computer had the patience to play tens of thousands of games against itself,"}, {"start": 68.12, "end": 73.88, "text": " it was able to get so much checkers playing experience that eventually it became a better"}, {"start": 73.88, "end": 77.75999999999999, "text": " checkers player than Arthur Samuel himself."}, {"start": 77.75999999999999, "end": 82.6, "text": " Now throughout these videos, besides me trying to talk about stuff, I'll occasionally ask"}, {"start": 82.6, "end": 86.36, "text": " you a question to help make sure you understand the content."}, {"start": 86.36, "end": 91.08, "text": " Here's one about what happens if the computer had played far fewer games."}, {"start": 91.08, "end": 99.03999999999999, "text": " Please take a look and pick whichever you think is a better answer."}, {"start": 99.03999999999999, "end": 101.03999999999999, "text": " Thanks for looking at the quiz."}, {"start": 101.03999999999999, "end": 109.11999999999999, "text": " And so if you had selected this answer, whether made it worse, then you got it right."}, {"start": 109.12, "end": 113.48, "text": " In general, the more opportunities you give a learning algorithm to learn, the better"}, {"start": 113.48, "end": 115.16000000000001, "text": " it will perform."}, {"start": 115.16000000000001, "end": 119.66000000000001, "text": " If you didn't select the correct answer the first time, that's totally okay too."}, {"start": 119.66000000000001, "end": 123.64, "text": " The point of these quiz questions isn't to see if you can get them all correct on the"}, {"start": 123.64, "end": 125.0, "text": " first try."}, {"start": 125.0, "end": 129.56, "text": " These questions are here just to help you practice the concepts you're learning."}, {"start": 129.56, "end": 132.88, "text": " Arthur Samuel's definition was a rather informal one."}, {"start": 132.88, "end": 137.68, "text": " But in the next two videos, we'll dive deeper together into what are the major types of"}, {"start": 137.68, "end": 141.16, "text": " machine learning algorithms."}, {"start": 141.16, "end": 145.12, "text": " In this class, you learn about many different learning algorithms."}, {"start": 145.12, "end": 151.78, "text": " The two main types of machine learning are supervised learning and unsupervised learning."}, {"start": 151.78, "end": 156.8, "text": " We'll define what these terms mean more in the next couple videos."}, {"start": 156.8, "end": 162.48000000000002, "text": " Of these two, supervised learning is the type of machine learning that is used most in many"}, {"start": 162.48, "end": 169.32, "text": " real world applications and that has seen the most rapid advancement and innovation."}, {"start": 169.32, "end": 174.98, "text": " In this specialization, which has three causes in total, the first and second causes will"}, {"start": 174.98, "end": 180.35999999999999, "text": " focus on supervised learning and the third will focus on unsupervised learning, recommender"}, {"start": 180.35999999999999, "end": 183.6, "text": " systems and reinforcement learning."}, {"start": 183.6, "end": 189.44, "text": " By far, the most used types of learning algorithms today are supervised learning, unsupervised"}, {"start": 189.44, "end": 192.52, "text": " learning and recommender systems."}, {"start": 192.52, "end": 197.2, "text": " The other thing we're going to spend a lot of time on in this specialization is practical"}, {"start": 197.2, "end": 200.68, "text": " advice for applying learning algorithms."}, {"start": 200.68, "end": 203.28, "text": " This is something I feel pretty strongly about."}, {"start": 203.28, "end": 208.52, "text": " Teaching about learning algorithms is like giving someone a set of tools and equally"}, {"start": 208.52, "end": 214.48, "text": " important or even more important than making sure you have great tools is making sure you"}, {"start": 214.48, "end": 216.56, "text": " know how to apply them."}, {"start": 216.56, "end": 221.6, "text": " Because you know, what good is it if someone were to give you a state of the art hammer"}, {"start": 221.6, "end": 225.32, "text": " or a state of the art hand drill and say, good luck, now you have all the tools you"}, {"start": 225.32, "end": 227.12, "text": " need to build a three story house."}, {"start": 227.12, "end": 229.68, "text": " It doesn't really work like that."}, {"start": 229.68, "end": 235.28, "text": " And so too in machine learning, making sure you have the tools is really important."}, {"start": 235.28, "end": 241.02, "text": " And so it's making sure that you know how to apply the tools of machine learning effectively."}, {"start": 241.02, "end": 245.2, "text": " So that's what you get in this class, the tools as well as the skills of applying them"}, {"start": 245.2, "end": 247.11999999999998, "text": " effectively."}, {"start": 247.11999999999998, "end": 252.07999999999998, "text": " I regularly visit with friends and teams in some of the top tech companies."}, {"start": 252.07999999999998, "end": 257.64, "text": " And even today, I see experienced machine learning teams apply machine learning algorithms"}, {"start": 257.64, "end": 259.2, "text": " to some problems."}, {"start": 259.2, "end": 263.96, "text": " And sometimes they've been going at it for six months without much success."}, {"start": 263.96, "end": 268.12, "text": " And when I look at what they're doing, I sometimes feel like I could have told them six months"}, {"start": 268.12, "end": 270.65999999999997, "text": " ago that the current approach won't work."}, {"start": 270.65999999999997, "end": 274.53999999999996, "text": " And there's a different way of using these tools that will give them a much better chance"}, {"start": 274.54, "end": 276.08000000000004, "text": " of success."}, {"start": 276.08000000000004, "end": 281.16, "text": " So in this class, one of the relatively unique things you learn is you learn a lot about"}, {"start": 281.16, "end": 287.6, "text": " the best practices for how to actually develop a practical, valuable machine learning system."}, {"start": 287.6, "end": 291.64000000000004, "text": " This way, you're less likely to end up in one of those teams that end up losing six"}, {"start": 291.64000000000004, "end": 294.68, "text": " months going in the wrong direction."}, {"start": 294.68, "end": 299.32000000000005, "text": " In this class, you gain a sense of how the most skilled machine learning engineers build"}, {"start": 299.32000000000005, "end": 300.32000000000005, "text": " systems."}, {"start": 300.32, "end": 306.04, "text": " I hope you finish this class as one of those very rare people in today's world that know"}, {"start": 306.04, "end": 309.88, "text": " how to design and build serious machine learning systems."}, {"start": 309.88, "end": 312.04, "text": " So that's machine learning."}, {"start": 312.04, "end": 317.8, "text": " In the next video, let's look more deeply at what is supervised learning and also what"}, {"start": 317.8, "end": 320.03999999999996, "text": " is unsupervised learning."}, {"start": 320.03999999999996, "end": 325.12, "text": " In addition, you learn when you might want to use each of them, supervised and unsupervised"}, {"start": 325.12, "end": 326.12, "text": " learning."}, {"start": 326.12, "end": 330.68, "text": " I'll see you in the next video."}]
Machine Learning Specialization 2022 -- Andrew Ng, Stanford University.
https://www.youtube.com/watch?v=hHYcNPfbBXQ
1.3 Machine Learning Overview | Applications of machine learning -- [Machine Learning | Andrew Ng]
First Course: Supervised Machine Learning : Regression and Classification. If you liked the content please subscribe and put a little blue thumb. Take heart!
In this class, you learn about the state of the art and also practice implementing machine learning algorithms yourself. You learn about the most important machine learning algorithms, some of which are exactly what's being used in large AI or large tech companies today, and you get a sense of what is the state of the art in AI. Beyond learning the algorithms though, in this class, you also learn all the important practical tips and tricks for making them perform well, and you get to implement them and see how they work for yourself. So why is machine learning so widely used today? Machine learning had grown up as a subfield of AI or artificial intelligence. We wanted to build intelligent machines, and it turns out that there are a few basic things that we could program a machine to do, such as how to find the shortest path from A to B like in your GPS. But for the most part, we just did not know how to write an explicit program to do many of the more interesting things, such as perform web search, recognize human speech, diagnose diseases from x-rays, or build a self-driving car. The only way we knew how to do these things was to have a machine learn to do it by itself. For me, when I founded and was leading the Google Brain team, I worked on problems like speech recognition, computer vision for Google Maps to view images, and advertising. Or leading AI by do, I worked on everything from AI for augmented reality to combating payment fraud to leading a self-driving car team. Most recently, at Landing AI, AI Fund, and Stanford University, I've been getting to work on AI applications in manufacturing, large-scale agriculture, healthcare, e-commerce, and other problems. Today, there are hundreds of thousands, perhaps millions of people, working on machine learning applications who could tell you similar stories about their work with machine learning. When you've learned these skills, I hope that you too will find it great fun to dabble in exciting different applications and maybe even different industries. In fact, I find it hard to think of any industry that machine learning is unlikely to touch in a significant way now or in the near future. Moving even further into the future, many people, including me, are excited about the AI dream of someday building machines as intelligent as you or me. This is sometimes called artificial general intelligence, or AGI. I think AGI has been overhyped and we're still a long way away from that goal. I don't know if it'll take 50 years or 500 years or longer to get there, but most AI researchers believe that the best way to get closer to what that goal is by using learning algorithms, maybe ones that take some inspiration from how the human brain works. You also hear a little more about this quest for AGI later in this course. According to a study by McKinsey, AI and machine learning is estimated to create an additional 13 trillion US dollars of value annually by the year 2030. Even though machine learning is already creating tremendous amounts of value in the software industry, I think there could be even vastly greater value that has yet to be created outside the software industry in sectors such as retail, travel, transportation, automotive, materials, manufacturing, and so on. Because of the massive untapped opportunities across so many different sectors, today there is a vast unfulfilled demand for this skill set. That's why this is such a great time to be learning about machine learning. If you find machine learning applications exciting, I hope you stick with me through this course. I can almost guarantee that you'll find mastering these skills worthwhile. In the next video, we'll look at a more formal definition of what is machine learning and we'll begin to talk about the main types of machine learning problems and algorithms. You pick up some of the main machine learning terminology and start to get a sense of what are the different algorithms and when each one might be appropriate. So let's go on to the next video.
[{"start": 0.0, "end": 6.88, "text": " In this class, you learn about the state of the art and also practice implementing machine"}, {"start": 6.88, "end": 9.4, "text": " learning algorithms yourself."}, {"start": 9.4, "end": 13.88, "text": " You learn about the most important machine learning algorithms, some of which are exactly"}, {"start": 13.88, "end": 19.44, "text": " what's being used in large AI or large tech companies today, and you get a sense of what"}, {"start": 19.44, "end": 22.48, "text": " is the state of the art in AI."}, {"start": 22.48, "end": 27.68, "text": " Beyond learning the algorithms though, in this class, you also learn all the important"}, {"start": 27.68, "end": 32.8, "text": " practical tips and tricks for making them perform well, and you get to implement them"}, {"start": 32.8, "end": 36.12, "text": " and see how they work for yourself."}, {"start": 36.12, "end": 40.4, "text": " So why is machine learning so widely used today?"}, {"start": 40.4, "end": 45.4, "text": " Machine learning had grown up as a subfield of AI or artificial intelligence."}, {"start": 45.4, "end": 49.8, "text": " We wanted to build intelligent machines, and it turns out that there are a few basic things"}, {"start": 49.8, "end": 54.120000000000005, "text": " that we could program a machine to do, such as how to find the shortest path from A to"}, {"start": 54.120000000000005, "end": 56.379999999999995, "text": " B like in your GPS."}, {"start": 56.38, "end": 61.64, "text": " But for the most part, we just did not know how to write an explicit program to do many"}, {"start": 61.64, "end": 67.0, "text": " of the more interesting things, such as perform web search, recognize human speech, diagnose"}, {"start": 67.0, "end": 70.74000000000001, "text": " diseases from x-rays, or build a self-driving car."}, {"start": 70.74000000000001, "end": 78.24000000000001, "text": " The only way we knew how to do these things was to have a machine learn to do it by itself."}, {"start": 78.24000000000001, "end": 83.24000000000001, "text": " For me, when I founded and was leading the Google Brain team, I worked on problems like"}, {"start": 83.24, "end": 89.16, "text": " speech recognition, computer vision for Google Maps to view images, and advertising."}, {"start": 89.16, "end": 95.19999999999999, "text": " Or leading AI by do, I worked on everything from AI for augmented reality to combating"}, {"start": 95.19999999999999, "end": 99.11999999999999, "text": " payment fraud to leading a self-driving car team."}, {"start": 99.11999999999999, "end": 103.36, "text": " Most recently, at Landing AI, AI Fund, and Stanford University, I've been getting to"}, {"start": 103.36, "end": 108.75999999999999, "text": " work on AI applications in manufacturing, large-scale agriculture, healthcare, e-commerce,"}, {"start": 108.75999999999999, "end": 109.75999999999999, "text": " and other problems."}, {"start": 109.76, "end": 114.76, "text": " Today, there are hundreds of thousands, perhaps millions of people, working on machine learning"}, {"start": 114.76, "end": 119.88000000000001, "text": " applications who could tell you similar stories about their work with machine learning."}, {"start": 119.88000000000001, "end": 124.84, "text": " When you've learned these skills, I hope that you too will find it great fun to dabble in"}, {"start": 124.84, "end": 128.28, "text": " exciting different applications and maybe even different industries."}, {"start": 128.28, "end": 134.08, "text": " In fact, I find it hard to think of any industry that machine learning is unlikely to touch"}, {"start": 134.08, "end": 138.6, "text": " in a significant way now or in the near future."}, {"start": 138.6, "end": 144.28, "text": " Moving even further into the future, many people, including me, are excited about the"}, {"start": 144.28, "end": 149.04, "text": " AI dream of someday building machines as intelligent as you or me."}, {"start": 149.04, "end": 154.28, "text": " This is sometimes called artificial general intelligence, or AGI."}, {"start": 154.28, "end": 159.6, "text": " I think AGI has been overhyped and we're still a long way away from that goal."}, {"start": 159.6, "end": 166.07999999999998, "text": " I don't know if it'll take 50 years or 500 years or longer to get there, but most AI researchers"}, {"start": 166.08, "end": 172.36, "text": " believe that the best way to get closer to what that goal is by using learning algorithms,"}, {"start": 172.36, "end": 176.4, "text": " maybe ones that take some inspiration from how the human brain works."}, {"start": 176.4, "end": 182.48000000000002, "text": " You also hear a little more about this quest for AGI later in this course."}, {"start": 182.48000000000002, "end": 188.64000000000001, "text": " According to a study by McKinsey, AI and machine learning is estimated to create an additional"}, {"start": 188.64000000000001, "end": 194.4, "text": " 13 trillion US dollars of value annually by the year 2030."}, {"start": 194.4, "end": 198.56, "text": " Even though machine learning is already creating tremendous amounts of value in the software"}, {"start": 198.56, "end": 205.56, "text": " industry, I think there could be even vastly greater value that has yet to be created outside"}, {"start": 205.56, "end": 211.92000000000002, "text": " the software industry in sectors such as retail, travel, transportation, automotive, materials,"}, {"start": 211.92000000000002, "end": 214.84, "text": " manufacturing, and so on."}, {"start": 214.84, "end": 220.12, "text": " Because of the massive untapped opportunities across so many different sectors, today there"}, {"start": 220.12, "end": 225.08, "text": " is a vast unfulfilled demand for this skill set."}, {"start": 225.08, "end": 229.64000000000001, "text": " That's why this is such a great time to be learning about machine learning."}, {"start": 229.64000000000001, "end": 234.8, "text": " If you find machine learning applications exciting, I hope you stick with me through"}, {"start": 234.8, "end": 235.8, "text": " this course."}, {"start": 235.8, "end": 240.76, "text": " I can almost guarantee that you'll find mastering these skills worthwhile."}, {"start": 240.76, "end": 248.32, "text": " In the next video, we'll look at a more formal definition of what is machine learning and"}, {"start": 248.32, "end": 254.28, "text": " we'll begin to talk about the main types of machine learning problems and algorithms."}, {"start": 254.28, "end": 260.24, "text": " You pick up some of the main machine learning terminology and start to get a sense of what"}, {"start": 260.24, "end": 265.32, "text": " are the different algorithms and when each one might be appropriate."}, {"start": 265.32, "end": 278.84, "text": " So let's go on to the next video."}]
Machine Learning Specialization 2022 -- Andrew Ng, Stanford University.
https://www.youtube.com/watch?v=EZN_uM3J3kI
1.4 Machine Learning Overview | Supervised learning part 1 --[Machine Learning | Andrew Ng]
First Course: Supervised Machine Learning : Regression and Classification. If you liked the content please subscribe and put a little blue thumb. Take heart!
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."}]
Machine Learning Specialization 2022 -- Andrew Ng, Stanford University.
https://www.youtube.com/watch?v=l16C3PKiHKg
1.5 Machine Learning Overview | Supervised learning part 2 --[Machine Learning | Andrew Ng]
First Course: Supervised Machine Learning : Regression and Classification. If you liked the content please subscribe and put a little blue thumb. Take heart! First Course: Supervised Machine Learning : Regression and Classification. If you liked the content please subscribe and put a little blue thumb. Take heart!
So, supervised learning algorithms learn to predict input-output or x-to-y mappings, and in the last video you saw that regression algorithms, which is a type of supervised learning algorithm, learn to predict numbers out of infinitely many possible numbers. There's a second major type of supervised learning algorithm called a classification algorithm. Let's take a look at what this means. Take breast cancer detection as an example of a classification problem. Say you're building a machine learning system so that doctors can have a diagnostic tool to detect breast cancer. This is important because early detection could potentially save a patient's life. Using a patient's medical records, your machine learning system tries to figure out if a tumor that is a lump is malignant, meaning cancerous or dangerous, or if that tumor, that lump, is benign, meaning that it's just a lump that isn't cancerous and isn't that dangerous. Some of my friends have actually been working on this specific problem. So maybe your dataset has tumors of various sizes, and these tumors are labeled as either benign, which I will designate in this example with a zero, or malignant, which I'll designate in this example with a one. You can then plot your data on a graph like this, where the horizontal axis represents the size of the tumor and the vertical axis takes on only two values, zero or one, depending on whether the tumor is benign, zero, or malignant, one. One reason that this is different from regression is that we're trying to predict only a small number of possible outputs or categories. In this case, two possible outputs, zero or one, benign or malignant. This is different from regression, which tries to predict any number out of an infinitely many number of possible numbers. And so the fact that there are only two possible outputs is what makes this classification. Because there are only two possible outputs or two possible categories in this example, you can also plot this dataset on a line like this, where now I'm going to use two different symbols to denote the category using a circle or an O to denote the benign examples and a cross to denote the malignant examples. And if a new patient walks in for a diagnosis and they have a lump that is this size, then the question is, will your system classify this tumor as benign or malignant? It turns out that in classification problems, you can also have more than two possible output categories. Maybe your learning algorithm can output multiple types of cancer diagnoses if it turns out to be malignant. So let's call two different types of cancer type one and type two. In this case, the algorithm would have three possible output categories it could predict. And by the way, in classification, the terms output classes and output categories are often used interchangeably, so when I say class or category, when referring to the output, it means the same thing. So to summarize, classification algorithms predict categories. Categories don't have to be numbers. It could be non-numeric. For example, it can predict whether a picture is that of a cat or a dog. And it can predict if a tumor is benign or malignant. Categories can also be numbers like zero or one or zero or one or two. But what makes classification different from regression when you're interpreting the numbers is that classification predicts a small, finite, limited set of possible output categories such as zero, one and two, but not all possible numbers in between like 0.5 or 1.7. In the example of supervised learning that we've been looking at, we had only one input value, the size of the tumor. But you can also use more than one input value to predict an output. Here's an example, instead of just knowing the tumor size, say you also have each patient's age in years. Your new data set now has two inputs, age and tumor size. Plotting this new data set, we're going to use circles to show patients whose tumors are benign and crosses to show the patients with a tumor that was malignant. So when a new patient comes in, the doctor can measure the patient's tumor size and also record the patient's age. And so given this, how can we predict if this patient's tumor is benign or malignant? Well, given a data set like this, what the learning algorithm might do is find some boundary that separates out the malignant tumors from the benign ones. So the learning algorithm has to decide how to fit a boundary line to this data. The boundary line found by the learning algorithm will help the doctor with the diagnosis. In this case, the tumor is more likely to be benign. From this example, we've seen how two inputs, the patient's age and tumor size can be used. In other machine learning problems, often many more input values are required. My friends who worked on breast cancer detection use many additional inputs like the thickness of the tumor clump, uniformity of the cell size, uniformity of the cell shape, and so on. So to recap, supervised learning maps input X to output Y, where the learning algorithm learns from the quote, right answers. The two major types of supervised learning are regression and classification. In a regression application, like predicting prices of houses, the learning algorithm has to predict numbers from infinitely many possible output numbers. Whereas in classification, the learning algorithm has to make a prediction of a category, all of a small set of possible outputs. So you now know what is supervised learning, including both regression and classification. I hope you're having fun. Next, there's a second major type of machine learning called unsupervised learning. Let's go on to the next video to see what that is.
[{"start": 0.0, "end": 9.48, "text": " So, supervised learning algorithms learn to predict input-output or x-to-y mappings, and"}, {"start": 9.48, "end": 14.280000000000001, "text": " in the last video you saw that regression algorithms, which is a type of supervised"}, {"start": 14.280000000000001, "end": 19.64, "text": " learning algorithm, learn to predict numbers out of infinitely many possible numbers."}, {"start": 19.64, "end": 24.92, "text": " There's a second major type of supervised learning algorithm called a classification"}, {"start": 24.92, "end": 25.92, "text": " algorithm."}, {"start": 25.92, "end": 29.34, "text": " Let's take a look at what this means."}, {"start": 29.34, "end": 35.519999999999996, "text": " Take breast cancer detection as an example of a classification problem."}, {"start": 35.519999999999996, "end": 39.72, "text": " Say you're building a machine learning system so that doctors can have a diagnostic tool"}, {"start": 39.72, "end": 41.8, "text": " to detect breast cancer."}, {"start": 41.8, "end": 47.16, "text": " This is important because early detection could potentially save a patient's life."}, {"start": 47.16, "end": 52.44, "text": " Using a patient's medical records, your machine learning system tries to figure out if a tumor"}, {"start": 52.44, "end": 60.16, "text": " that is a lump is malignant, meaning cancerous or dangerous, or if that tumor, that lump,"}, {"start": 60.16, "end": 67.08, "text": " is benign, meaning that it's just a lump that isn't cancerous and isn't that dangerous."}, {"start": 67.08, "end": 71.4, "text": " Some of my friends have actually been working on this specific problem."}, {"start": 71.4, "end": 78.6, "text": " So maybe your dataset has tumors of various sizes, and these tumors are labeled as either"}, {"start": 78.6, "end": 85.88, "text": " benign, which I will designate in this example with a zero, or malignant, which I'll designate"}, {"start": 85.88, "end": 88.96, "text": " in this example with a one."}, {"start": 88.96, "end": 95.44, "text": " You can then plot your data on a graph like this, where the horizontal axis represents"}, {"start": 95.44, "end": 102.46, "text": " the size of the tumor and the vertical axis takes on only two values, zero or one, depending"}, {"start": 102.46, "end": 108.52, "text": " on whether the tumor is benign, zero, or malignant, one."}, {"start": 108.52, "end": 116.24, "text": " One reason that this is different from regression is that we're trying to predict only a small"}, {"start": 116.24, "end": 119.44, "text": " number of possible outputs or categories."}, {"start": 119.44, "end": 124.91999999999999, "text": " In this case, two possible outputs, zero or one, benign or malignant."}, {"start": 124.91999999999999, "end": 130.38, "text": " This is different from regression, which tries to predict any number out of an infinitely"}, {"start": 130.38, "end": 135.1, "text": " many number of possible numbers."}, {"start": 135.1, "end": 142.0, "text": " And so the fact that there are only two possible outputs is what makes this classification."}, {"start": 142.0, "end": 148.44, "text": " Because there are only two possible outputs or two possible categories in this example,"}, {"start": 148.44, "end": 155.44, "text": " you can also plot this dataset on a line like this, where now I'm going to use two different"}, {"start": 155.44, "end": 163.54, "text": " symbols to denote the category using a circle or an O to denote the benign examples and"}, {"start": 163.54, "end": 168.04, "text": " a cross to denote the malignant examples."}, {"start": 168.04, "end": 175.68, "text": " And if a new patient walks in for a diagnosis and they have a lump that is this size, then"}, {"start": 175.68, "end": 183.23999999999998, "text": " the question is, will your system classify this tumor as benign or malignant?"}, {"start": 183.23999999999998, "end": 188.5, "text": " It turns out that in classification problems, you can also have more than two possible output"}, {"start": 188.5, "end": 190.5, "text": " categories."}, {"start": 190.5, "end": 195.52, "text": " Maybe your learning algorithm can output multiple types of cancer diagnoses if it turns out"}, {"start": 195.52, "end": 197.94, "text": " to be malignant."}, {"start": 197.94, "end": 202.88, "text": " So let's call two different types of cancer type one and type two."}, {"start": 202.88, "end": 210.36, "text": " In this case, the algorithm would have three possible output categories it could predict."}, {"start": 210.36, "end": 216.82, "text": " And by the way, in classification, the terms output classes and output categories are often"}, {"start": 216.82, "end": 222.32, "text": " used interchangeably, so when I say class or category, when referring to the output,"}, {"start": 222.32, "end": 224.56, "text": " it means the same thing."}, {"start": 224.56, "end": 231.44, "text": " So to summarize, classification algorithms predict categories."}, {"start": 231.44, "end": 233.12, "text": " Categories don't have to be numbers."}, {"start": 233.12, "end": 234.12, "text": " It could be non-numeric."}, {"start": 234.12, "end": 242.22, "text": " For example, it can predict whether a picture is that of a cat or a dog."}, {"start": 242.22, "end": 247.84, "text": " And it can predict if a tumor is benign or malignant."}, {"start": 247.84, "end": 253.28, "text": " Categories can also be numbers like zero or one or zero or one or two."}, {"start": 253.28, "end": 258.64, "text": " But what makes classification different from regression when you're interpreting the numbers"}, {"start": 258.64, "end": 265.8, "text": " is that classification predicts a small, finite, limited set of possible output categories"}, {"start": 265.8, "end": 274.84000000000003, "text": " such as zero, one and two, but not all possible numbers in between like 0.5 or 1.7."}, {"start": 274.84000000000003, "end": 279.76, "text": " In the example of supervised learning that we've been looking at, we had only one input"}, {"start": 279.76, "end": 285.48, "text": " value, the size of the tumor."}, {"start": 285.48, "end": 291.52, "text": " But you can also use more than one input value to predict an output."}, {"start": 291.52, "end": 297.71999999999997, "text": " Here's an example, instead of just knowing the tumor size, say you also have each patient's"}, {"start": 297.71999999999997, "end": 299.79999999999995, "text": " age in years."}, {"start": 299.79999999999995, "end": 305.24, "text": " Your new data set now has two inputs, age and tumor size."}, {"start": 305.24, "end": 309.88, "text": " Plotting this new data set, we're going to use circles to show patients whose tumors"}, {"start": 309.88, "end": 317.84, "text": " are benign and crosses to show the patients with a tumor that was malignant."}, {"start": 317.84, "end": 322.88, "text": " So when a new patient comes in, the doctor can measure the patient's tumor size and also"}, {"start": 322.88, "end": 325.88, "text": " record the patient's age."}, {"start": 325.88, "end": 332.15999999999997, "text": " And so given this, how can we predict if this patient's tumor is benign or malignant?"}, {"start": 332.15999999999997, "end": 338.67999999999995, "text": " Well, given a data set like this, what the learning algorithm might do is find some boundary"}, {"start": 338.67999999999995, "end": 344.62, "text": " that separates out the malignant tumors from the benign ones."}, {"start": 344.62, "end": 350.76, "text": " So the learning algorithm has to decide how to fit a boundary line to this data."}, {"start": 350.76, "end": 356.0, "text": " The boundary line found by the learning algorithm will help the doctor with the diagnosis."}, {"start": 356.0, "end": 361.32, "text": " In this case, the tumor is more likely to be benign."}, {"start": 361.32, "end": 367.52, "text": " From this example, we've seen how two inputs, the patient's age and tumor size can be used."}, {"start": 367.52, "end": 373.4, "text": " In other machine learning problems, often many more input values are required."}, {"start": 373.4, "end": 378.03999999999996, "text": " My friends who worked on breast cancer detection use many additional inputs like the thickness"}, {"start": 378.03999999999996, "end": 383.15999999999997, "text": " of the tumor clump, uniformity of the cell size, uniformity of the cell shape, and so"}, {"start": 383.15999999999997, "end": 384.15999999999997, "text": " on."}, {"start": 384.15999999999997, "end": 392.2, "text": " So to recap, supervised learning maps input X to output Y, where the learning algorithm"}, {"start": 392.2, "end": 395.84, "text": " learns from the quote, right answers."}, {"start": 395.84, "end": 401.59999999999997, "text": " The two major types of supervised learning are regression and classification."}, {"start": 401.6, "end": 406.44, "text": " In a regression application, like predicting prices of houses, the learning algorithm has"}, {"start": 406.44, "end": 411.08000000000004, "text": " to predict numbers from infinitely many possible output numbers."}, {"start": 411.08000000000004, "end": 416.08000000000004, "text": " Whereas in classification, the learning algorithm has to make a prediction of a category, all"}, {"start": 416.08000000000004, "end": 419.32000000000005, "text": " of a small set of possible outputs."}, {"start": 419.32000000000005, "end": 425.56, "text": " So you now know what is supervised learning, including both regression and classification."}, {"start": 425.56, "end": 427.24, "text": " I hope you're having fun."}, {"start": 427.24, "end": 433.08, "text": " Next, there's a second major type of machine learning called unsupervised learning."}, {"start": 433.08, "end": 460.44, "text": " Let's go on to the next video to see what that is."}]
Machine Learning Specialization 2022 -- Andrew Ng, Stanford University.
https://www.youtube.com/watch?v=yzAFnfHYH9E
1.6 Machine Learning Overview | Unsupervised learning part 1 --[Machine Learning | Andrew Ng]
First Course: Supervised Machine Learning : Regression and Classification. If you liked the content please subscribe and put a little blue thumb. Take heart!
After supervised learning, the most widely used form of machine learning is unsupervised learning. Let's take a look at what that means. We've talked about supervised learning, and this video is about unsupervised learning. But don't let the name unsupervised fool you. Unsupervised learning is, I think, just as super as supervised learning. When we're looking at supervised learning in the last video, recall that it looks something like this. In the case of a classification problem, each example was associated with an output label Y such as benign or malignant, designated by the O's and crosses. In unsupervised learning, we're given data that isn't associated with any output labels Y. Say you're given data on patients and their tumor size and the patient's age, but not whether the tumor was benign or malignant. So the data set looks like this on the right. We're not asked to diagnose whether the tumor is benign or malignant because we're not given any labels Y in the data set. Instead, our job is to find some structure or some pattern or just find something interesting in the data. This is unsupervised learning. We call it unsupervised because we're not trying to supervise the algorithm to give some quote right answer for every input. Instead, we ask the algorithm to figure out all by itself what's interesting or what patterns or structures there might be in this data. With this particular data set, an unsupervised learning algorithm might decide that the data can be assigned to two different groups or two different clusters. And so it might decide that there's one cluster or group over here and there's another cluster or group over here. This is a particular type of unsupervised learning called a clustering algorithm because it places the unlabeled data into different clusters. And this turns out to be used in many applications. For example, clustering is used in Google News. What Google News does is every day it goes and looks at hundreds of thousands of news articles on the internet and groups related stories together. For example, here's a sample from Google News where the headline of the top article is Giant Panda Gives Birth to Rare Twin Cubs at Japan's Older Zoo. This article actually caught my eye because my daughter loves pandas and so there are a lot of stuffed panda toys and watching of panda videos in my house. And looking at this, you might notice that below this are other related articles. Maybe from the headlines alone, you can start to guess what clustering might be doing. Notice that the word panda appears here, here, here, here, and here. And notice that the word twin also appears in all five articles. And the word zoo also appears in all of these articles. So the clustering algorithm is finding articles out of all the hundreds of thousands of news articles on the internet that day, finding the articles that mention similar words and grouping them into clusters. Now what's cool is that this clustering algorithm figures out on its own which words suggest that certain articles are in the same group. What I mean is there isn't an employee at Google News who's telling the algorithm to find articles of the word panda and twins and zoo to put them into the same cluster. The news topics change every day and there are so many news stories it just isn't feasible to have people doing this every single day for all the topics the news covers. Instead, the algorithm has to figure out on its own without supervision what are the clusters of news articles today. So that's why this clustering algorithm is a type of unsupervised learning algorithm. Let's look at a second example of unsupervised learning applied to clustering genetic or DNA data. This image shows a picture of DNA microarray data. These look like tiny grids of a spreadsheet and each tiny column represents the genetic or DNA activity of one person. So for example, this entire column here is from one person's DNA and this other column is of another person. Each row represents a particular gene. So just as an example, perhaps this row here might represent a gene that affects eye color or this row here is a gene that affects how tall someone is. Researchers have even found a genetic link to whether someone dislikes certain vegetables such as broccoli or Brussels sprouts or asparagus. So next time someone asks you, why didn't you finish a salad? You can tell them, oh, maybe it's genetic. For DNA microarrays, the idea is to measure how much certain genes are expressed for each individual person. So these colors, red, green, gray, and so on, show the degree to which different individuals do or do not have a specific gene active. And what you can do is then run a clustering algorithm to group individuals into different categories or different types of people. Like maybe these individuals are grouped together and let's just call this type one. And these people are grouped into type two and these people are grouped as type three. This is unsupervised learning because we're not telling the algorithm in advance that there is a type one person with certain characteristics or a type two person with certain characteristics. Instead, what we're saying is, here's a bunch of data. I don't know what the different types of people are, but can you automatically find structure into data and automatically figure out what are the major types of individuals? Since we're not giving the algorithm the right answer for the examples in advance, this is unsupervised learning. Here's a third example. Many companies have huge databases of customer information. Given this data, can you automatically group your customers into different market segments so that you can more efficiently serve your customers? Concretely, the deeplearning.ai team did some research to better understand the deeplearning.ai community and why different individuals take these classes, subscribe to the batch weekly newsletter or attend our PyLAI events. Let's visualize the deeplearning.ai community as this collection of people. Running clustering, that is market segmentation, found a few distinct groups of individuals. One group's primary motivation is seeking knowledge to grow their skills. Perhaps this is you. And if so, that's great. A second group's primary motivation is looking for a way to develop their career. Maybe you want to get a promotion or a new job or make some career progression. If this strives you, that's great too. And yet another group wants to stay updated on how AI impacts their field of work. Perhaps this is you. That's great too. This is the clustering that our team use to try to better serve our community as we're trying to figure out what are the major categories of learners in the deeplearning.ai community. So if any of these is your top motivation for learning, that's great. And I hope I'll be able to help you on your journey. Or in case this is you and you want something totally different than the other three categories, that's fine too. And I want you to know I love you all the same. So to summarize, a clustering algorithm, which is a type of unsophisticated learning algorithm, takes data without labels and tries to automatically group them into clusters. And so maybe the next time you see or think of a panda, maybe you'll think of clustering as well. And besides clustering, there are other types of unsophisticated learning as well. Let's go on to the next video to take a look at some other types of unsophisticated learning algorithms.
[{"start": 0.0, "end": 7.5200000000000005, "text": " After supervised learning, the most widely used form of machine learning is unsupervised"}, {"start": 7.5200000000000005, "end": 8.52, "text": " learning."}, {"start": 8.52, "end": 11.36, "text": " Let's take a look at what that means."}, {"start": 11.36, "end": 16.88, "text": " We've talked about supervised learning, and this video is about unsupervised learning."}, {"start": 16.88, "end": 20.16, "text": " But don't let the name unsupervised fool you."}, {"start": 20.16, "end": 25.2, "text": " Unsupervised learning is, I think, just as super as supervised learning."}, {"start": 25.2, "end": 29.46, "text": " When we're looking at supervised learning in the last video, recall that it looks something"}, {"start": 29.46, "end": 30.5, "text": " like this."}, {"start": 30.5, "end": 35.36, "text": " In the case of a classification problem, each example was associated with an output label"}, {"start": 35.36, "end": 41.8, "text": " Y such as benign or malignant, designated by the O's and crosses."}, {"start": 41.8, "end": 48.72, "text": " In unsupervised learning, we're given data that isn't associated with any output labels"}, {"start": 48.72, "end": 55.8, "text": " Y. Say you're given data on patients and their tumor size and the patient's age, but not"}, {"start": 55.8, "end": 59.44, "text": " whether the tumor was benign or malignant."}, {"start": 59.44, "end": 63.559999999999995, "text": " So the data set looks like this on the right."}, {"start": 63.559999999999995, "end": 71.12, "text": " We're not asked to diagnose whether the tumor is benign or malignant because we're not given"}, {"start": 71.12, "end": 73.44, "text": " any labels Y in the data set."}, {"start": 73.44, "end": 79.8, "text": " Instead, our job is to find some structure or some pattern or just find something interesting"}, {"start": 79.8, "end": 81.17999999999999, "text": " in the data."}, {"start": 81.17999999999999, "end": 83.6, "text": " This is unsupervised learning."}, {"start": 83.6, "end": 88.46, "text": " We call it unsupervised because we're not trying to supervise the algorithm to give"}, {"start": 88.46, "end": 91.96, "text": " some quote right answer for every input."}, {"start": 91.96, "end": 98.39999999999999, "text": " Instead, we ask the algorithm to figure out all by itself what's interesting or what patterns"}, {"start": 98.39999999999999, "end": 102.28, "text": " or structures there might be in this data."}, {"start": 102.28, "end": 107.36, "text": " With this particular data set, an unsupervised learning algorithm might decide that the data"}, {"start": 107.36, "end": 112.3, "text": " can be assigned to two different groups or two different clusters."}, {"start": 112.3, "end": 120.64, "text": " And so it might decide that there's one cluster or group over here and there's another cluster"}, {"start": 120.64, "end": 123.53999999999999, "text": " or group over here."}, {"start": 123.53999999999999, "end": 129.04, "text": " This is a particular type of unsupervised learning called a clustering algorithm because"}, {"start": 129.04, "end": 133.84, "text": " it places the unlabeled data into different clusters."}, {"start": 133.84, "end": 137.48, "text": " And this turns out to be used in many applications."}, {"start": 137.48, "end": 142.84, "text": " For example, clustering is used in Google News."}, {"start": 142.84, "end": 147.72, "text": " What Google News does is every day it goes and looks at hundreds of thousands of news"}, {"start": 147.72, "end": 152.14, "text": " articles on the internet and groups related stories together."}, {"start": 152.14, "end": 158.04, "text": " For example, here's a sample from Google News where the headline of the top article is Giant"}, {"start": 158.04, "end": 162.22, "text": " Panda Gives Birth to Rare Twin Cubs at Japan's Older Zoo."}, {"start": 162.22, "end": 167.23999999999998, "text": " This article actually caught my eye because my daughter loves pandas and so there are"}, {"start": 167.24, "end": 172.08, "text": " a lot of stuffed panda toys and watching of panda videos in my house."}, {"start": 172.08, "end": 180.04000000000002, "text": " And looking at this, you might notice that below this are other related articles."}, {"start": 180.04000000000002, "end": 186.24, "text": " Maybe from the headlines alone, you can start to guess what clustering might be doing."}, {"start": 186.24, "end": 194.70000000000002, "text": " Notice that the word panda appears here, here, here, here, and here."}, {"start": 194.7, "end": 201.95999999999998, "text": " And notice that the word twin also appears in all five articles."}, {"start": 201.95999999999998, "end": 206.33999999999997, "text": " And the word zoo also appears in all of these articles."}, {"start": 206.33999999999997, "end": 211.28, "text": " So the clustering algorithm is finding articles out of all the hundreds of thousands of news"}, {"start": 211.28, "end": 217.0, "text": " articles on the internet that day, finding the articles that mention similar words and"}, {"start": 217.0, "end": 219.64, "text": " grouping them into clusters."}, {"start": 219.64, "end": 225.32, "text": " Now what's cool is that this clustering algorithm figures out on its own which words suggest"}, {"start": 225.32, "end": 227.88, "text": " that certain articles are in the same group."}, {"start": 227.88, "end": 232.32, "text": " What I mean is there isn't an employee at Google News who's telling the algorithm to"}, {"start": 232.32, "end": 238.04, "text": " find articles of the word panda and twins and zoo to put them into the same cluster."}, {"start": 238.04, "end": 243.56, "text": " The news topics change every day and there are so many news stories it just isn't feasible"}, {"start": 243.56, "end": 249.2, "text": " to have people doing this every single day for all the topics the news covers."}, {"start": 249.2, "end": 255.67999999999998, "text": " Instead, the algorithm has to figure out on its own without supervision what are the clusters"}, {"start": 255.67999999999998, "end": 258.03999999999996, "text": " of news articles today."}, {"start": 258.03999999999996, "end": 264.15999999999997, "text": " So that's why this clustering algorithm is a type of unsupervised learning algorithm."}, {"start": 264.15999999999997, "end": 269.32, "text": " Let's look at a second example of unsupervised learning applied to clustering genetic or"}, {"start": 269.32, "end": 272.0, "text": " DNA data."}, {"start": 272.0, "end": 276.44, "text": " This image shows a picture of DNA microarray data."}, {"start": 276.44, "end": 282.08, "text": " These look like tiny grids of a spreadsheet and each tiny column represents the genetic"}, {"start": 282.08, "end": 285.76, "text": " or DNA activity of one person."}, {"start": 285.76, "end": 292.26, "text": " So for example, this entire column here is from one person's DNA and this other column"}, {"start": 292.26, "end": 294.96, "text": " is of another person."}, {"start": 294.96, "end": 298.3, "text": " Each row represents a particular gene."}, {"start": 298.3, "end": 304.4, "text": " So just as an example, perhaps this row here might represent a gene that affects eye color"}, {"start": 304.4, "end": 310.44, "text": " or this row here is a gene that affects how tall someone is."}, {"start": 310.44, "end": 314.79999999999995, "text": " Researchers have even found a genetic link to whether someone dislikes certain vegetables"}, {"start": 314.79999999999995, "end": 319.35999999999996, "text": " such as broccoli or Brussels sprouts or asparagus."}, {"start": 319.35999999999996, "end": 322.44, "text": " So next time someone asks you, why didn't you finish a salad?"}, {"start": 322.44, "end": 326.08, "text": " You can tell them, oh, maybe it's genetic."}, {"start": 326.08, "end": 332.4, "text": " For DNA microarrays, the idea is to measure how much certain genes are expressed for each"}, {"start": 332.4, "end": 334.12, "text": " individual person."}, {"start": 334.12, "end": 340.08, "text": " So these colors, red, green, gray, and so on, show the degree to which different individuals"}, {"start": 340.08, "end": 344.88, "text": " do or do not have a specific gene active."}, {"start": 344.88, "end": 351.28000000000003, "text": " And what you can do is then run a clustering algorithm to group individuals into different"}, {"start": 351.28000000000003, "end": 354.5, "text": " categories or different types of people."}, {"start": 354.5, "end": 360.28000000000003, "text": " Like maybe these individuals are grouped together and let's just call this type one."}, {"start": 360.28, "end": 369.4, "text": " And these people are grouped into type two and these people are grouped as type three."}, {"start": 369.4, "end": 373.84, "text": " This is unsupervised learning because we're not telling the algorithm in advance that"}, {"start": 373.84, "end": 378.79999999999995, "text": " there is a type one person with certain characteristics or a type two person with certain characteristics."}, {"start": 378.79999999999995, "end": 382.4, "text": " Instead, what we're saying is, here's a bunch of data."}, {"start": 382.4, "end": 387.28, "text": " I don't know what the different types of people are, but can you automatically find structure"}, {"start": 387.28, "end": 392.32, "text": " into data and automatically figure out what are the major types of individuals?"}, {"start": 392.32, "end": 397.32, "text": " Since we're not giving the algorithm the right answer for the examples in advance, this is"}, {"start": 397.32, "end": 398.79999999999995, "text": " unsupervised learning."}, {"start": 398.79999999999995, "end": 401.76, "text": " Here's a third example."}, {"start": 401.76, "end": 406.59999999999997, "text": " Many companies have huge databases of customer information."}, {"start": 406.59999999999997, "end": 412.11999999999995, "text": " Given this data, can you automatically group your customers into different market segments"}, {"start": 412.11999999999995, "end": 416.03999999999996, "text": " so that you can more efficiently serve your customers?"}, {"start": 416.04, "end": 421.84000000000003, "text": " Concretely, the deeplearning.ai team did some research to better understand the deeplearning.ai"}, {"start": 421.84000000000003, "end": 427.68, "text": " community and why different individuals take these classes, subscribe to the batch weekly"}, {"start": 427.68, "end": 432.08000000000004, "text": " newsletter or attend our PyLAI events."}, {"start": 432.08000000000004, "end": 437.72, "text": " Let's visualize the deeplearning.ai community as this collection of people."}, {"start": 437.72, "end": 445.52000000000004, "text": " Running clustering, that is market segmentation, found a few distinct groups of individuals."}, {"start": 445.52, "end": 450.91999999999996, "text": " One group's primary motivation is seeking knowledge to grow their skills."}, {"start": 450.91999999999996, "end": 451.91999999999996, "text": " Perhaps this is you."}, {"start": 451.91999999999996, "end": 453.64, "text": " And if so, that's great."}, {"start": 453.64, "end": 458.47999999999996, "text": " A second group's primary motivation is looking for a way to develop their career."}, {"start": 458.47999999999996, "end": 462.53999999999996, "text": " Maybe you want to get a promotion or a new job or make some career progression."}, {"start": 462.53999999999996, "end": 465.62, "text": " If this strives you, that's great too."}, {"start": 465.62, "end": 471.5, "text": " And yet another group wants to stay updated on how AI impacts their field of work."}, {"start": 471.5, "end": 473.2, "text": " Perhaps this is you."}, {"start": 473.2, "end": 474.64, "text": " That's great too."}, {"start": 474.64, "end": 480.24, "text": " This is the clustering that our team use to try to better serve our community as we're"}, {"start": 480.24, "end": 486.94, "text": " trying to figure out what are the major categories of learners in the deeplearning.ai community."}, {"start": 486.94, "end": 490.47999999999996, "text": " So if any of these is your top motivation for learning, that's great."}, {"start": 490.47999999999996, "end": 493.84, "text": " And I hope I'll be able to help you on your journey."}, {"start": 493.84, "end": 500.0, "text": " Or in case this is you and you want something totally different than the other three categories,"}, {"start": 500.0, "end": 501.0, "text": " that's fine too."}, {"start": 501.0, "end": 504.58, "text": " And I want you to know I love you all the same."}, {"start": 504.58, "end": 509.76, "text": " So to summarize, a clustering algorithm, which is a type of unsophisticated learning algorithm,"}, {"start": 509.76, "end": 515.64, "text": " takes data without labels and tries to automatically group them into clusters."}, {"start": 515.64, "end": 521.12, "text": " And so maybe the next time you see or think of a panda, maybe you'll think of clustering"}, {"start": 521.12, "end": 522.68, "text": " as well."}, {"start": 522.68, "end": 527.48, "text": " And besides clustering, there are other types of unsophisticated learning as well."}, {"start": 527.48, "end": 531.56, "text": " Let's go on to the next video to take a look at some other types of unsophisticated learning"}, {"start": 531.56, "end": 535.1999999999999, "text": " algorithms."}]
Machine Learning Specialization 2022 -- Andrew Ng, Stanford University.
https://www.youtube.com/watch?v=u7Y_b04upmQ
1.7 Machine Learning Overview | Unsupervised learning part 2 --[Machine Learning | Andrew Ng]
First Course: Supervised Machine Learning : Regression and Classification. If you liked the content please subscribe and put a little blue thumb. Take heart! First Course: Supervised Machine Learning : Regression and Classification. If you liked the content please subscribe and put a little blue thumb. Take heart!
In the last video, you saw what is unsupervised learning and one type of unsupervised learning called clustering. Let's give a slightly more formal definition of unsupervised learning and take a quick look at some other types of unsupervised learning other than clustering. Whereas in supervised learning, the data comes with both inputs x and output labels y, in unsupervised learning, the data comes only with inputs x but not output labels y, and the algorithm has to find some structure or some pattern or something interesting in the data. We've seen just one example of unsupervised learning called a clustering algorithm, which groups similar data points together. In this specialization, you learn about clustering as well as two other types of unsupervised learning. One is called anomaly detection, which is used to detect unusual events. This turns out to be really important for fraud detection in the financial system, where unusual events, unusual transactions could be a sign of fraud and for many other applications. And you also learn about dimensionality reduction. This lets you take a big data set and almost magically compress it to a much smaller data set while losing as little information as possible. In case anomaly detection and dimensionality reduction don't seem to make too much sense to you yet, don't worry about it. We'll get to this later in this specialization. Now, I'd like to ask you another question to help you check your understanding. And no pressure, if you don't get it right on the first try, it's totally fine. Please select any of the following that you think are examples of unsupervised learning. Two are unsupervised examples and two are supervised learning examples. So please take a look. Maybe you remember the spam filtering problem. If you have labeled data, you know, labeled as spam or non spam email, you can treat this as a supervised learning problem. The second example, the news story example. That's exactly the Google News and Tandem example that you saw in the last video. And so you can approach that using a clustering algorithm to group news articles together. So that would use unsupervised learning. The market segmentation example that I talked about a little bit earlier, you can do that as an unsupervised learning problem as well, because you can give your algorithm some data and ask it to discover market segments automatically. And the final example on diagnosing diabetes. Well, actually, that's a lot like our breast cancer example from the supervised learning videos. Only instead of benign or malignant tumors, we instead have diabetes or not diabetes. And so you can approach this as a supervised learning problem, just like we did for the breast tumor classification problem. Even though in this in the last video, we've talked mainly about clustering in later videos in this specialization, we'll dive much more deeply into anomaly detection and dimensionality reduction as well. So that's unsupervised learning. Before we wrap up this section, I want to share with you something that I find really exciting and useful, which is the use of Jupyter notebooks in machine learning. Let's take a look at that in the next video.
[{"start": 0.0, "end": 6.88, "text": " In the last video, you saw what is unsupervised learning and one type of unsupervised learning"}, {"start": 6.88, "end": 7.88, "text": " called clustering."}, {"start": 7.88, "end": 13.52, "text": " Let's give a slightly more formal definition of unsupervised learning and take a quick"}, {"start": 13.52, "end": 18.04, "text": " look at some other types of unsupervised learning other than clustering."}, {"start": 18.04, "end": 23.88, "text": " Whereas in supervised learning, the data comes with both inputs x and output labels y, in"}, {"start": 23.88, "end": 30.52, "text": " unsupervised learning, the data comes only with inputs x but not output labels y, and"}, {"start": 30.52, "end": 35.6, "text": " the algorithm has to find some structure or some pattern or something interesting in the"}, {"start": 35.6, "end": 36.6, "text": " data."}, {"start": 36.6, "end": 43.76, "text": " We've seen just one example of unsupervised learning called a clustering algorithm, which"}, {"start": 43.76, "end": 46.379999999999995, "text": " groups similar data points together."}, {"start": 46.379999999999995, "end": 52.84, "text": " In this specialization, you learn about clustering as well as two other types of unsupervised"}, {"start": 52.84, "end": 53.84, "text": " learning."}, {"start": 53.84, "end": 60.28, "text": " One is called anomaly detection, which is used to detect unusual events."}, {"start": 60.28, "end": 65.88000000000001, "text": " This turns out to be really important for fraud detection in the financial system, where"}, {"start": 65.88000000000001, "end": 73.56, "text": " unusual events, unusual transactions could be a sign of fraud and for many other applications."}, {"start": 73.56, "end": 77.5, "text": " And you also learn about dimensionality reduction."}, {"start": 77.5, "end": 83.16, "text": " This lets you take a big data set and almost magically compress it to a much smaller data"}, {"start": 83.16, "end": 87.4, "text": " set while losing as little information as possible."}, {"start": 87.4, "end": 92.36, "text": " In case anomaly detection and dimensionality reduction don't seem to make too much sense"}, {"start": 92.36, "end": 94.32, "text": " to you yet, don't worry about it."}, {"start": 94.32, "end": 96.68, "text": " We'll get to this later in this specialization."}, {"start": 96.68, "end": 103.64, "text": " Now, I'd like to ask you another question to help you check your understanding."}, {"start": 103.64, "end": 108.2, "text": " And no pressure, if you don't get it right on the first try, it's totally fine."}, {"start": 108.2, "end": 114.68, "text": " Please select any of the following that you think are examples of unsupervised learning."}, {"start": 114.68, "end": 119.78, "text": " Two are unsupervised examples and two are supervised learning examples."}, {"start": 119.78, "end": 124.32, "text": " So please take a look."}, {"start": 124.32, "end": 127.16, "text": " Maybe you remember the spam filtering problem."}, {"start": 127.16, "end": 132.82, "text": " If you have labeled data, you know, labeled as spam or non spam email, you can treat this"}, {"start": 132.82, "end": 135.79999999999998, "text": " as a supervised learning problem."}, {"start": 135.79999999999998, "end": 138.72, "text": " The second example, the news story example."}, {"start": 138.72, "end": 143.98, "text": " That's exactly the Google News and Tandem example that you saw in the last video."}, {"start": 143.98, "end": 149.74, "text": " And so you can approach that using a clustering algorithm to group news articles together."}, {"start": 149.74, "end": 153.16, "text": " So that would use unsupervised learning."}, {"start": 153.16, "end": 158.12, "text": " The market segmentation example that I talked about a little bit earlier, you can do that"}, {"start": 158.12, "end": 163.56, "text": " as an unsupervised learning problem as well, because you can give your algorithm some data"}, {"start": 163.56, "end": 168.20000000000002, "text": " and ask it to discover market segments automatically."}, {"start": 168.20000000000002, "end": 171.4, "text": " And the final example on diagnosing diabetes."}, {"start": 171.4, "end": 176.84, "text": " Well, actually, that's a lot like our breast cancer example from the supervised learning"}, {"start": 176.84, "end": 177.84, "text": " videos."}, {"start": 177.84, "end": 184.38, "text": " Only instead of benign or malignant tumors, we instead have diabetes or not diabetes."}, {"start": 184.38, "end": 188.44, "text": " And so you can approach this as a supervised learning problem, just like we did for the"}, {"start": 188.44, "end": 191.85999999999999, "text": " breast tumor classification problem."}, {"start": 191.85999999999999, "end": 197.64, "text": " Even though in this in the last video, we've talked mainly about clustering in later videos"}, {"start": 197.64, "end": 202.84, "text": " in this specialization, we'll dive much more deeply into anomaly detection and dimensionality"}, {"start": 202.84, "end": 205.84, "text": " reduction as well."}, {"start": 205.84, "end": 208.48, "text": " So that's unsupervised learning."}, {"start": 208.48, "end": 212.06, "text": " Before we wrap up this section, I want to share with you something that I find really"}, {"start": 212.06, "end": 216.44, "text": " exciting and useful, which is the use of Jupyter notebooks in machine learning."}, {"start": 216.44, "end": 243.44, "text": " Let's take a look at that in the next video."}]
Machine Learning Specialization 2022 -- Andrew Ng, Stanford University.
https://www.youtube.com/watch?v=SRDUSIcnW8M
1.8 Machine Learning Overview | Jupyter Notebooks --[Machine Learning | Andrew Ng]
First Course: Supervised Machine Learning : Regression and Classification. If you liked the content please subscribe and put a little blue thumb. Take heart!
So far in the videos, you've seen supervised learning and unsupervised learning, and also examples of both. For you to more deeply understand these concepts, I'd like to invite you in this class to see, run, and maybe later write code yourself to implement these concepts. The most widely used tool by machine learning and data science practitioners today is the Jupyter Notebook. This is the default environment that a lot of us use to code up and experiment and try things out. And so in this class, right here in your web browser, you'll be able to use a Jupyter Notebook environment to test out some of these ideas for yourself as well. This is not some made up, simplified environment. This is the exact same environment, the exact same tool, the Jupyter Notebook that developers are using in many large companies right now. One type of lab that you see throughout this class are optional labs, which are ones you can open and run one line at a time with usually not needing to write any code yourself. So optional labs are designed to be very easy, and I can guarantee you will get full marks for every single one of them, because there are no marks. All you need to do is open it up and just run the code we've provided. And by reading through and running the code in the optional labs, you see how machine learning code runs. And you should be able to complete them relatively quickly, just by running it one line at a time from top to bottom. Optional labs are completely optional, so you don't have to do them at all if you don't want to. But I hope you will take a look, because running through them will give you a deeper feel, give you a little bit more experience with what machine learning algorithms, what machine learning code actually looks like. Starting next week, there will also be some practice labs, which will give you an opportunity to write some of that code yourself. But we'll get to that next week, so don't worry about it for now. And I hope you just go through the next optional lab and get through the rest of the content for this week. So let's take a look at an example of a notebook. This is what you see when you go to the first optional lab. Feel free to scroll up and down and browse and mouse over the different menus and take a look at the different options here. You might notice that there are two types of these blocks, also called cells, in the notebook. And there are two types of cells. One is what's called a markdown cell, which means basically a bunch of text. So here you can actually edit the text if you don't like the text that we wrote. But this is text that describes the code. Then there's a second type of block or cell, which looks like this, which is a code cell. So here we've already provided the code. And if you want to run this code cell, hitting shift enter will run the code in this code cell. Oh, and by the way, if you click on a markdown cell, so it's showing all this formatting, go ahead and hit shift enter on your keyboard as well. And that will also convert it back to this nicely formatted text. This optional lab shows some common Python code. So you can go ahead and run this afterwards in your own Jupyter notebook. When you jump into this notebook yourself, what I'd like you to do is select the cells and hit shift enter. Well, read through the code, see if it makes sense, you know, try to make a prediction about what you think this code will do, and then hit shift enter and then see what the code actually does. And if you feel like it, feel free to go in and edit the code, you know, change the code and then run it and see what happens. And if you haven't played in a Jupyter notebook environment before, I hope you become more familiar with Python in a Jupyter notebook. I spend a lot of hours playing around in Jupyter notebooks, and so I hope you have fun with them too. And after that, I look forward to seeing you in the next video, where we'll take the supervised learning problem and start to flesh out our first supervised learning algorithm. I hope that'll be fun too, and look forward to seeing you there.
[{"start": 0.0, "end": 8.6, "text": " So far in the videos, you've seen supervised learning and unsupervised learning, and also"}, {"start": 8.6, "end": 10.6, "text": " examples of both."}, {"start": 10.6, "end": 16.72, "text": " For you to more deeply understand these concepts, I'd like to invite you in this class to see,"}, {"start": 16.72, "end": 21.98, "text": " run, and maybe later write code yourself to implement these concepts."}, {"start": 21.98, "end": 26.740000000000002, "text": " The most widely used tool by machine learning and data science practitioners today is the"}, {"start": 26.740000000000002, "end": 28.46, "text": " Jupyter Notebook."}, {"start": 28.46, "end": 33.44, "text": " This is the default environment that a lot of us use to code up and experiment and try"}, {"start": 33.44, "end": 34.92, "text": " things out."}, {"start": 34.92, "end": 40.28, "text": " And so in this class, right here in your web browser, you'll be able to use a Jupyter Notebook"}, {"start": 40.28, "end": 45.08, "text": " environment to test out some of these ideas for yourself as well."}, {"start": 45.08, "end": 48.72, "text": " This is not some made up, simplified environment."}, {"start": 48.72, "end": 54.24, "text": " This is the exact same environment, the exact same tool, the Jupyter Notebook that developers"}, {"start": 54.24, "end": 57.64, "text": " are using in many large companies right now."}, {"start": 57.64, "end": 62.36, "text": " One type of lab that you see throughout this class are optional labs, which are ones you"}, {"start": 62.36, "end": 70.04, "text": " can open and run one line at a time with usually not needing to write any code yourself."}, {"start": 70.04, "end": 76.12, "text": " So optional labs are designed to be very easy, and I can guarantee you will get full marks"}, {"start": 76.12, "end": 80.02, "text": " for every single one of them, because there are no marks."}, {"start": 80.02, "end": 84.68, "text": " All you need to do is open it up and just run the code we've provided."}, {"start": 84.68, "end": 89.2, "text": " And by reading through and running the code in the optional labs, you see how machine"}, {"start": 89.2, "end": 91.44000000000001, "text": " learning code runs."}, {"start": 91.44000000000001, "end": 97.88000000000001, "text": " And you should be able to complete them relatively quickly, just by running it one line at a"}, {"start": 97.88000000000001, "end": 100.68, "text": " time from top to bottom."}, {"start": 100.68, "end": 104.76, "text": " Optional labs are completely optional, so you don't have to do them at all if you don't"}, {"start": 104.76, "end": 105.76, "text": " want to."}, {"start": 105.76, "end": 111.4, "text": " But I hope you will take a look, because running through them will give you a deeper feel,"}, {"start": 111.4, "end": 115.64, "text": " give you a little bit more experience with what machine learning algorithms, what machine"}, {"start": 115.64, "end": 119.12, "text": " learning code actually looks like."}, {"start": 119.12, "end": 123.36000000000001, "text": " Starting next week, there will also be some practice labs, which will give you an opportunity"}, {"start": 123.36000000000001, "end": 126.0, "text": " to write some of that code yourself."}, {"start": 126.0, "end": 129.08, "text": " But we'll get to that next week, so don't worry about it for now."}, {"start": 129.08, "end": 133.76, "text": " And I hope you just go through the next optional lab and get through the rest of the content"}, {"start": 133.76, "end": 134.76, "text": " for this week."}, {"start": 134.76, "end": 138.84, "text": " So let's take a look at an example of a notebook."}, {"start": 138.84, "end": 142.36, "text": " This is what you see when you go to the first optional lab."}, {"start": 142.36, "end": 147.6, "text": " Feel free to scroll up and down and browse and mouse over the different menus and take"}, {"start": 147.6, "end": 151.28, "text": " a look at the different options here."}, {"start": 151.28, "end": 156.24, "text": " You might notice that there are two types of these blocks, also called cells, in the"}, {"start": 156.24, "end": 157.72, "text": " notebook."}, {"start": 157.72, "end": 160.24, "text": " And there are two types of cells."}, {"start": 160.24, "end": 166.36, "text": " One is what's called a markdown cell, which means basically a bunch of text."}, {"start": 166.36, "end": 171.4, "text": " So here you can actually edit the text if you don't like the text that we wrote."}, {"start": 171.4, "end": 175.48000000000002, "text": " But this is text that describes the code."}, {"start": 175.48000000000002, "end": 182.76000000000002, "text": " Then there's a second type of block or cell, which looks like this, which is a code cell."}, {"start": 182.76000000000002, "end": 185.16000000000003, "text": " So here we've already provided the code."}, {"start": 185.16000000000003, "end": 190.64000000000001, "text": " And if you want to run this code cell, hitting shift enter will run the code in this code"}, {"start": 190.64000000000001, "end": 191.64000000000001, "text": " cell."}, {"start": 191.64, "end": 197.64, "text": " Oh, and by the way, if you click on a markdown cell, so it's showing all this formatting,"}, {"start": 197.64, "end": 201.67999999999998, "text": " go ahead and hit shift enter on your keyboard as well."}, {"start": 201.67999999999998, "end": 206.48, "text": " And that will also convert it back to this nicely formatted text."}, {"start": 206.48, "end": 209.77999999999997, "text": " This optional lab shows some common Python code."}, {"start": 209.77999999999997, "end": 214.5, "text": " So you can go ahead and run this afterwards in your own Jupyter notebook."}, {"start": 214.5, "end": 219.33999999999997, "text": " When you jump into this notebook yourself, what I'd like you to do is select the cells"}, {"start": 219.33999999999997, "end": 221.2, "text": " and hit shift enter."}, {"start": 221.2, "end": 225.48, "text": " Well, read through the code, see if it makes sense, you know, try to make a prediction"}, {"start": 225.48, "end": 232.07999999999998, "text": " about what you think this code will do, and then hit shift enter and then see what the"}, {"start": 232.07999999999998, "end": 234.07999999999998, "text": " code actually does."}, {"start": 234.07999999999998, "end": 238.16, "text": " And if you feel like it, feel free to go in and edit the code, you know, change the code"}, {"start": 238.16, "end": 240.95999999999998, "text": " and then run it and see what happens."}, {"start": 240.95999999999998, "end": 245.28, "text": " And if you haven't played in a Jupyter notebook environment before, I hope you become more"}, {"start": 245.28, "end": 248.76, "text": " familiar with Python in a Jupyter notebook."}, {"start": 248.76, "end": 253.72, "text": " I spend a lot of hours playing around in Jupyter notebooks, and so I hope you have fun with"}, {"start": 253.72, "end": 255.12, "text": " them too."}, {"start": 255.12, "end": 259.92, "text": " And after that, I look forward to seeing you in the next video, where we'll take the supervised"}, {"start": 259.92, "end": 265.86, "text": " learning problem and start to flesh out our first supervised learning algorithm."}, {"start": 265.86, "end": 279.36, "text": " I hope that'll be fun too, and look forward to seeing you there."}]
Machine Learning Specialization 2022 -- Andrew Ng, Stanford University.
https://www.youtube.com/watch?v=isx7QB_j4jY
1.9 Machine Learning Overview | Linear regression model part 1 --[Machine Learning | Andrew Ng]
First Course: Supervised Machine Learning : Regression and Classification. If you liked the content please subscribe and put a little blue thumb. Take heart!
In this video, we'll look at what the overall process of supervised learning is like. Specifically, you see the first model of this course, a linear regression model. That just means filling a straight line to your data. It's probably the most widely used learning algorithm in the world today. And as you get familiar with linear regression, many of the concepts you see here will also apply to other machine learning models, models that you'll see later in this specialization. Let's start with a problem that you can address using linear regression. Say you want to predict the price of a house based on the size of a house. This is example we see in earlier this week. We're going to use a data set on house sizes and prices from Portland, a city in the United States. Here with a graph where the horizontal axis is the size of the house in square feet and the vertical axis is the price of the house in thousands of dollars. Let's go ahead and plot the data points for various houses in the data set. Here each data point, each of these little crosses is a house with a size and a price that it most recently was sold for. Now let's say you're a real estate agent in Portland and you're helping a client sell her house. And she's asking you, how much do you think you're going to get for this house? This data set might help you estimate the price she could get for it. You start by measuring the size of the house and it turns out that her house is 1250 square feet. How much do you think this house could sell for? One thing you could do is you can build a linear regression model from this data set. Your model will fit a straight line to the data, which might look like this. And based on this straight line fit to the data, you can kind of see that if a house is 1250 square feet, it will intersect the best fit line over here. And if you trace that to the vertical axis on the left, you can see the prices may be around here, say about $220,000. So this is an example of what's called a supervised learning model. We call this supervised learning because you are first training your model by giving it data that has the right answers. Because you give the model examples of houses with both the size of the house as well as the price that the model should predict for each house. Where here are the prices, that is the right answers are given for every house in the data set. This linear regression model is a particular type of supervised learning model. It's called a regression model because it predicts numbers as the output, like prices and dollars. Any supervised learning model that predicts a number, such as 220,000 or 1.5 or negative 33.2 is addressing what's called a regression problem. So linear regression is one example of a regression model, but there are other models for addressing regression problems too. And we'll see some of those later in course two of this specialization. And just to remind you, in contrast with the regression model, the other most common type of supervised learning model is called a classification model. A classification model predicts categories or discrete categories, such as predicting if a picture is of a cat meow or a dog woof. Or if given a medical record, it has to predict if a patient has a particular disease. You see more about classification models later in this course as well. So as a reminder about the difference between classification and regression, in classification, there are only a small number of possible outputs. If your model is recognizing cats versus dogs, that's two possible outputs. Or maybe you're trying to recognize any of 10 possible medical conditions in a patient. So there's a discrete, finite set of possible outputs. We call it a classification problem. Whereas in regression, there are infinitely many possible numbers that the model could output. In addition to visualizing this data as a plot here on the left, there's one other way of looking at the data that would be useful. And that's a data table here on the right. The data comprises a set of inputs. This would be the size of the house, which is this column here. It also has outputs, you're trying to predict the price, which is this column here. Notice that the horizontal and vertical axes correspond to these two columns, the size and the price. And so if you have, say, 47 rows in this data table, then there are 47 of these little crosses on the plot of the left, each cross corresponding to one row of the table. For example, the first row of the table is a house with size 2104 square feet. So that's around here. And this house, so for $400,000, which is around here. So this first row of the table is plotted as this data point over here. Now let's look at some notation for describing the data. This is notation that you find useful throughout your journey in machine learning. As you increasingly get familiar with machine learning terminology, this would be terminology that you can use to talk about machine learning concepts with others as well, since a lot of this is quite standard across AI. You'll be seeing this notation multiple times in this specialization. So it's okay if you don't remember everything the first time through, it will naturally become more familiar over time. The data set that you just saw and that is used to train the model is called a training set. Note that your client's house is not in this data set because it's not yet sold. So no one knows what his price is. So to predict the price of your client's house, you first train your model to learn from the training set and that model can then predict your client's house's price. In machine learning, the standard notation to denote the input here is lowercase x and we call this the input variable. It's also called a feature or an input feature. For example, for the first house in your training set, x is the size of the house, so x equals 2104. The standard notation to denote the output variable, which you're trying to predict, which is also sometimes called the target variable, is lowercase y. And so here, y is the price of the house and for the first training example, this is equal to 400. So y equals 400. So the data set has one row for each house and in this particular training set, there are 47 rows with each row representing a different training example. We're going to use lowercase m to refer to the total number of training examples and so here, m is equal to 47. To indicate a single training example, we're going to use the notation parentheses x comma y. So for the first training example, x comma y, this pair of numbers is 2104 comma 400. Now we have a lot of different training examples. We have 47 of them in fact. So to refer to a specific training example, this will correspond to a specific row in this table on the left. I'm going to use the notation x superscript in parentheses i comma y superscript in parentheses i. The superscript tells us that this is the i-th training example, such as the first, second or third up to the 47th training example. i here refers to a specific row in the table. So for instance, here is the first example when i equals 1 in the training set. And so x superscript 1 is equal to 2104 and y superscript 1 is equal to 400. And let's add the superscript 1 here as well. Just a note, this superscript i in parentheses is not exponentiation. So when I write this, this is not x squared. This is not x to the power of 2. It just refers to the second training example. So this i is just an index in the training set and refers to row i in the table. In this video, you saw what a training set is like as well as standard notation for describing this training set. In the next video, let's look at what it'll take to take this training set that you just saw and feed it to a learning algorithm so that the algorithm can learn from this data. We'll see that in the next video.
[{"start": 0.0, "end": 8.0, "text": " In this video, we'll look at what the overall process of supervised learning is like."}, {"start": 8.0, "end": 14.24, "text": " Specifically, you see the first model of this course, a linear regression model."}, {"start": 14.24, "end": 17.52, "text": " That just means filling a straight line to your data."}, {"start": 17.52, "end": 21.92, "text": " It's probably the most widely used learning algorithm in the world today."}, {"start": 21.92, "end": 27.32, "text": " And as you get familiar with linear regression, many of the concepts you see here will also"}, {"start": 27.32, "end": 34.4, "text": " apply to other machine learning models, models that you'll see later in this specialization."}, {"start": 34.4, "end": 38.44, "text": " Let's start with a problem that you can address using linear regression."}, {"start": 38.44, "end": 42.28, "text": " Say you want to predict the price of a house based on the size of a house."}, {"start": 42.28, "end": 45.56, "text": " This is example we see in earlier this week."}, {"start": 45.56, "end": 51.72, "text": " We're going to use a data set on house sizes and prices from Portland, a city in the United"}, {"start": 51.72, "end": 53.120000000000005, "text": " States."}, {"start": 53.12, "end": 58.16, "text": " Here with a graph where the horizontal axis is the size of the house in square feet and"}, {"start": 58.16, "end": 63.76, "text": " the vertical axis is the price of the house in thousands of dollars."}, {"start": 63.76, "end": 68.36, "text": " Let's go ahead and plot the data points for various houses in the data set."}, {"start": 68.36, "end": 74.44, "text": " Here each data point, each of these little crosses is a house with a size and a price"}, {"start": 74.44, "end": 77.88, "text": " that it most recently was sold for."}, {"start": 77.88, "end": 83.39999999999999, "text": " Now let's say you're a real estate agent in Portland and you're helping a client sell"}, {"start": 83.39999999999999, "end": 84.39999999999999, "text": " her house."}, {"start": 84.39999999999999, "end": 87.8, "text": " And she's asking you, how much do you think you're going to get for this house?"}, {"start": 87.8, "end": 92.52, "text": " This data set might help you estimate the price she could get for it."}, {"start": 92.52, "end": 98.28, "text": " You start by measuring the size of the house and it turns out that her house is 1250 square"}, {"start": 98.28, "end": 99.39999999999999, "text": " feet."}, {"start": 99.39999999999999, "end": 102.52, "text": " How much do you think this house could sell for?"}, {"start": 102.52, "end": 108.0, "text": " One thing you could do is you can build a linear regression model from this data set."}, {"start": 108.0, "end": 113.36, "text": " Your model will fit a straight line to the data, which might look like this."}, {"start": 113.36, "end": 117.6, "text": " And based on this straight line fit to the data, you can kind of see that if a house"}, {"start": 117.6, "end": 124.64, "text": " is 1250 square feet, it will intersect the best fit line over here."}, {"start": 124.64, "end": 129.28, "text": " And if you trace that to the vertical axis on the left, you can see the prices may be"}, {"start": 129.28, "end": 133.16, "text": " around here, say about $220,000."}, {"start": 133.16, "end": 138.04, "text": " So this is an example of what's called a supervised learning model."}, {"start": 138.04, "end": 142.2, "text": " We call this supervised learning because you are first training your model by giving it"}, {"start": 142.2, "end": 144.72, "text": " data that has the right answers."}, {"start": 144.72, "end": 148.76, "text": " Because you give the model examples of houses with both the size of the house as well as"}, {"start": 148.76, "end": 152.36, "text": " the price that the model should predict for each house."}, {"start": 152.36, "end": 157.6, "text": " Where here are the prices, that is the right answers are given for every house in the data"}, {"start": 157.6, "end": 159.08, "text": " set."}, {"start": 159.08, "end": 163.56, "text": " This linear regression model is a particular type of supervised learning model."}, {"start": 163.56, "end": 168.16000000000003, "text": " It's called a regression model because it predicts numbers as the output, like prices"}, {"start": 168.16000000000003, "end": 169.88000000000002, "text": " and dollars."}, {"start": 169.88000000000002, "end": 177.96, "text": " Any supervised learning model that predicts a number, such as 220,000 or 1.5 or negative"}, {"start": 177.96, "end": 183.64000000000001, "text": " 33.2 is addressing what's called a regression problem."}, {"start": 183.64, "end": 190.0, "text": " So linear regression is one example of a regression model, but there are other models for addressing"}, {"start": 190.0, "end": 192.55999999999997, "text": " regression problems too."}, {"start": 192.55999999999997, "end": 198.2, "text": " And we'll see some of those later in course two of this specialization."}, {"start": 198.2, "end": 203.88, "text": " And just to remind you, in contrast with the regression model, the other most common type"}, {"start": 203.88, "end": 208.72, "text": " of supervised learning model is called a classification model."}, {"start": 208.72, "end": 214.68, "text": " A classification model predicts categories or discrete categories, such as predicting"}, {"start": 214.68, "end": 219.72, "text": " if a picture is of a cat meow or a dog woof."}, {"start": 219.72, "end": 225.52, "text": " Or if given a medical record, it has to predict if a patient has a particular disease."}, {"start": 225.52, "end": 230.24, "text": " You see more about classification models later in this course as well."}, {"start": 230.24, "end": 235.76, "text": " So as a reminder about the difference between classification and regression, in classification,"}, {"start": 235.76, "end": 239.23999999999998, "text": " there are only a small number of possible outputs."}, {"start": 239.23999999999998, "end": 245.48, "text": " If your model is recognizing cats versus dogs, that's two possible outputs."}, {"start": 245.48, "end": 252.82, "text": " Or maybe you're trying to recognize any of 10 possible medical conditions in a patient."}, {"start": 252.82, "end": 256.52, "text": " So there's a discrete, finite set of possible outputs."}, {"start": 256.52, "end": 259.03999999999996, "text": " We call it a classification problem."}, {"start": 259.03999999999996, "end": 263.12, "text": " Whereas in regression, there are infinitely many possible numbers that the model could"}, {"start": 263.12, "end": 264.62, "text": " output."}, {"start": 264.62, "end": 270.36, "text": " In addition to visualizing this data as a plot here on the left, there's one other way"}, {"start": 270.36, "end": 274.4, "text": " of looking at the data that would be useful."}, {"start": 274.4, "end": 278.88, "text": " And that's a data table here on the right."}, {"start": 278.88, "end": 282.16, "text": " The data comprises a set of inputs."}, {"start": 282.16, "end": 286.68, "text": " This would be the size of the house, which is this column here."}, {"start": 286.68, "end": 295.12, "text": " It also has outputs, you're trying to predict the price, which is this column here."}, {"start": 295.12, "end": 302.8, "text": " Notice that the horizontal and vertical axes correspond to these two columns, the size"}, {"start": 302.8, "end": 305.2, "text": " and the price."}, {"start": 305.2, "end": 315.08, "text": " And so if you have, say, 47 rows in this data table, then there are 47 of these little crosses"}, {"start": 315.08, "end": 322.84, "text": " on the plot of the left, each cross corresponding to one row of the table."}, {"start": 322.84, "end": 331.4, "text": " For example, the first row of the table is a house with size 2104 square feet."}, {"start": 331.4, "end": 335.36, "text": " So that's around here."}, {"start": 335.36, "end": 342.41999999999996, "text": " And this house, so for $400,000, which is around here."}, {"start": 342.42, "end": 349.56, "text": " So this first row of the table is plotted as this data point over here."}, {"start": 349.56, "end": 353.98, "text": " Now let's look at some notation for describing the data."}, {"start": 353.98, "end": 359.0, "text": " This is notation that you find useful throughout your journey in machine learning."}, {"start": 359.0, "end": 364.36, "text": " As you increasingly get familiar with machine learning terminology, this would be terminology"}, {"start": 364.36, "end": 369.44, "text": " that you can use to talk about machine learning concepts with others as well, since a lot"}, {"start": 369.44, "end": 373.2, "text": " of this is quite standard across AI."}, {"start": 373.2, "end": 377.04, "text": " You'll be seeing this notation multiple times in this specialization."}, {"start": 377.04, "end": 381.56, "text": " So it's okay if you don't remember everything the first time through, it will naturally"}, {"start": 381.56, "end": 385.08, "text": " become more familiar over time."}, {"start": 385.08, "end": 392.08, "text": " The data set that you just saw and that is used to train the model is called a training"}, {"start": 392.08, "end": 393.08, "text": " set."}, {"start": 393.08, "end": 398.76, "text": " Note that your client's house is not in this data set because it's not yet sold."}, {"start": 398.76, "end": 401.56, "text": " So no one knows what his price is."}, {"start": 401.56, "end": 406.88, "text": " So to predict the price of your client's house, you first train your model to learn from the"}, {"start": 406.88, "end": 414.03999999999996, "text": " training set and that model can then predict your client's house's price."}, {"start": 414.03999999999996, "end": 420.96, "text": " In machine learning, the standard notation to denote the input here is lowercase x and"}, {"start": 420.96, "end": 423.76, "text": " we call this the input variable."}, {"start": 423.76, "end": 429.59999999999997, "text": " It's also called a feature or an input feature."}, {"start": 429.59999999999997, "end": 436.52, "text": " For example, for the first house in your training set, x is the size of the house, so x equals"}, {"start": 436.52, "end": 440.28, "text": " 2104."}, {"start": 440.28, "end": 446.92, "text": " The standard notation to denote the output variable, which you're trying to predict,"}, {"start": 446.92, "end": 455.64000000000004, "text": " which is also sometimes called the target variable, is lowercase y."}, {"start": 455.64000000000004, "end": 462.6, "text": " And so here, y is the price of the house and for the first training example, this is equal"}, {"start": 462.6, "end": 464.5, "text": " to 400."}, {"start": 464.5, "end": 468.20000000000005, "text": " So y equals 400."}, {"start": 468.2, "end": 477.4, "text": " So the data set has one row for each house and in this particular training set, there"}, {"start": 477.4, "end": 484.2, "text": " are 47 rows with each row representing a different training example."}, {"start": 484.2, "end": 489.59999999999997, "text": " We're going to use lowercase m to refer to the total number of training examples and"}, {"start": 489.59999999999997, "end": 494.03999999999996, "text": " so here, m is equal to 47."}, {"start": 494.04, "end": 500.76000000000005, "text": " To indicate a single training example, we're going to use the notation parentheses x comma"}, {"start": 500.76000000000005, "end": 502.28000000000003, "text": " y."}, {"start": 502.28000000000003, "end": 514.28, "text": " So for the first training example, x comma y, this pair of numbers is 2104 comma 400."}, {"start": 514.28, "end": 517.44, "text": " Now we have a lot of different training examples."}, {"start": 517.44, "end": 519.46, "text": " We have 47 of them in fact."}, {"start": 519.46, "end": 526.0, "text": " So to refer to a specific training example, this will correspond to a specific row in"}, {"start": 526.0, "end": 527.72, "text": " this table on the left."}, {"start": 527.72, "end": 536.24, "text": " I'm going to use the notation x superscript in parentheses i comma y superscript in parentheses"}, {"start": 536.24, "end": 538.12, "text": " i."}, {"start": 538.12, "end": 545.6800000000001, "text": " The superscript tells us that this is the i-th training example, such as the first,"}, {"start": 545.68, "end": 549.52, "text": " second or third up to the 47th training example."}, {"start": 549.52, "end": 556.04, "text": " i here refers to a specific row in the table."}, {"start": 556.04, "end": 566.12, "text": " So for instance, here is the first example when i equals 1 in the training set."}, {"start": 566.12, "end": 577.32, "text": " And so x superscript 1 is equal to 2104 and y superscript 1 is equal to 400."}, {"start": 577.32, "end": 582.52, "text": " And let's add the superscript 1 here as well."}, {"start": 582.52, "end": 588.36, "text": " Just a note, this superscript i in parentheses is not exponentiation."}, {"start": 588.36, "end": 593.6800000000001, "text": " So when I write this, this is not x squared."}, {"start": 593.6800000000001, "end": 596.04, "text": " This is not x to the power of 2."}, {"start": 596.04, "end": 599.7199999999999, "text": " It just refers to the second training example."}, {"start": 599.7199999999999, "end": 606.8, "text": " So this i is just an index in the training set and refers to row i in the table."}, {"start": 606.8, "end": 612.48, "text": " In this video, you saw what a training set is like as well as standard notation for describing"}, {"start": 612.48, "end": 613.48, "text": " this training set."}, {"start": 613.48, "end": 617.64, "text": " In the next video, let's look at what it'll take to take this training set that you just"}, {"start": 617.64, "end": 624.1999999999999, "text": " saw and feed it to a learning algorithm so that the algorithm can learn from this data."}, {"start": 624.2, "end": 626.6, "text": " We'll see that in the next video."}]
Machine Learning Specialization 2022 -- Andrew Ng, Stanford University.
https://www.youtube.com/watch?v=vrTHO5zRq6s
1.10 Machine Learning Overview | Linear regression model part 2 --[Machine Learning | Andrew Ng]
First Course: Supervised Machine Learning : Regression and Classification. If you liked the content please subscribe and put a little blue thumb. Take heart! First Course: Supervised Machine Learning : Regression and Classification. If you liked the content please subscribe and put a little blue thumb. Take heart!
Let's look in this video at the process of how supervised learning works. Supervised learning algorithm will input a data set and then what exactly does it do and what does it output? Let's find out in this video. Recall that a training set in supervised learning includes both the input features, such as the size of the hulls, and also the output targets, such as the price of the hulls. The output targets are the right answers that the model will learn from. To train the model, you feed the training set, both the input features and the output targets, to your learning algorithm. Then your supervised learning algorithm will produce some function. We'll write this function as lowercase f, where f stands for function. Historically, this function used to be called a hypothesis, but I'm just going to call it a function f in this class. The job of f is to take a new input x and output an estimate or prediction, which I'm going to call y hat, and it's written like the variable y with this little hat symbol on top. In machine learning, the convention is that y hat is the estimate or the prediction for y. The function f is called the model. X is called the input or the input feature, and the output of the model is the prediction y hat. The model's prediction is the estimated value of y. When the symbol is just a letter y, then that refers to the target, which is the actual true value in the training set. In contrast, y hat is an estimate. It may or may not be the actual true value. Well, if you're helping your client to sell their hulls, well, the true price of the hulls is unknown until they sell it. So your model f, given the size, outputs a price which is the estimated, that is the prediction of what the true price will be. Now, when we design a learning algorithm, a key question is, how are we going to represent the function f? Or in other words, what is the math formula we're going to use to compute f? For now, let's stick with f being a straight line. So your function can be written as f subscript w comma b of x equals, I'm going to use w times x plus b. I'll define w and b soon, but for now, just know that w and b are numbers, and the values chosen for w and b will determine the prediction y hat based on the input feature x. So this f w b of x means f is a function that takes x's input, and depending on the values of w and b, f will output some value of a prediction y hat. As an alternative to writing this f w comma b of x, I'll sometimes just write f of x without explicitly including w and b in the subscript. It's just a simple notation, but means exactly the same thing as f w b of x. Let's plot the training set on the graph where the input feature x is on the horizontal axis, and the output target y is on the vertical axis. Remember, the algorithm learns from this data and generates a best fit line like maybe this one here. This straight line is the linear function f w b of x equals w times x plus b. Or more simply, we can drop w and b and just write f of x equals w x plus b. Here's what this function is doing, it's making predictions for the value of y using a straight line function of x. So you may ask, why are we choosing a linear function where linear function is just a fancy term for a straight line, instead of some nonlinear function like a curve or a parabola? Well, sometimes you want to fit more complex nonlinear functions as well, like a curve like this, but since this linear function is relatively simple and easy to work with, let's use a line as a foundation that will eventually help you to get to more complex models that are nonlinear. This particular model has a name, it's called linear regression. More specifically, this is linear regression with one variable, where the phrase one variable means that there's a single input variable or feature x, namely the size of the house. Another name for a linear model with one input variable is univariate linear regression, where uni means one in Latin and where variate means variable. So univariate is just a fancy way of saying one variable. In a later video, you'll also see a variation of regression where you want to make a prediction based not just on the size of a house, but on a bunch of other things that you may know about the house, such as number of bedrooms and other features. And by the way, when you're done with this video, there is another optional lab. You don't need to write any code, just review it, run the code and see what it does. That will show you how to define in Python a straight line function. And the lab will let you choose the values of W and B to try to fit the training data. You don't have to do the lab if you don't want to, but I hope you play of it when you're done watching this video. So that's linear regression. In order for you to make this work, one of the most important things you have to do is construct a cost function. The idea of a cost function is one of the most universal and important ideas in machine learning and is used in both linear regression and in training many of the most advanced AI models in the world. So let's go on to the next video and take a look at how you can construct a cost function.
[{"start": 0.0, "end": 7.38, "text": " Let's look in this video at the process of how supervised learning works."}, {"start": 7.38, "end": 11.3, "text": " Supervised learning algorithm will input a data set and then what exactly does it do"}, {"start": 11.3, "end": 12.84, "text": " and what does it output?"}, {"start": 12.84, "end": 15.68, "text": " Let's find out in this video."}, {"start": 15.68, "end": 21.0, "text": " Recall that a training set in supervised learning includes both the input features, such as"}, {"start": 21.0, "end": 26.16, "text": " the size of the hulls, and also the output targets, such as the price of the hulls."}, {"start": 26.16, "end": 31.08, "text": " The output targets are the right answers that the model will learn from."}, {"start": 31.08, "end": 35.8, "text": " To train the model, you feed the training set, both the input features and the output"}, {"start": 35.8, "end": 40.24, "text": " targets, to your learning algorithm."}, {"start": 40.24, "end": 45.28, "text": " Then your supervised learning algorithm will produce some function."}, {"start": 45.28, "end": 50.08, "text": " We'll write this function as lowercase f, where f stands for function."}, {"start": 50.08, "end": 55.6, "text": " Historically, this function used to be called a hypothesis, but I'm just going to call"}, {"start": 55.6, "end": 58.800000000000004, "text": " it a function f in this class."}, {"start": 58.800000000000004, "end": 69.36, "text": " The job of f is to take a new input x and output an estimate or prediction, which I'm"}, {"start": 69.36, "end": 76.44, "text": " going to call y hat, and it's written like the variable y with this little hat symbol"}, {"start": 76.44, "end": 78.52000000000001, "text": " on top."}, {"start": 78.52, "end": 85.84, "text": " In machine learning, the convention is that y hat is the estimate or the prediction for"}, {"start": 85.84, "end": 88.0, "text": " y."}, {"start": 88.0, "end": 92.0, "text": " The function f is called the model."}, {"start": 92.0, "end": 99.12, "text": " X is called the input or the input feature, and the output of the model is the prediction"}, {"start": 99.12, "end": 101.12, "text": " y hat."}, {"start": 101.12, "end": 105.88, "text": " The model's prediction is the estimated value of y."}, {"start": 105.88, "end": 112.6, "text": " When the symbol is just a letter y, then that refers to the target, which is the actual"}, {"start": 112.6, "end": 115.75999999999999, "text": " true value in the training set."}, {"start": 115.75999999999999, "end": 118.56, "text": " In contrast, y hat is an estimate."}, {"start": 118.56, "end": 120.96, "text": " It may or may not be the actual true value."}, {"start": 120.96, "end": 126.6, "text": " Well, if you're helping your client to sell their hulls, well, the true price of the hulls"}, {"start": 126.6, "end": 129.2, "text": " is unknown until they sell it."}, {"start": 129.2, "end": 135.2, "text": " So your model f, given the size, outputs a price which is the estimated, that is the"}, {"start": 135.2, "end": 138.79999999999998, "text": " prediction of what the true price will be."}, {"start": 138.79999999999998, "end": 146.67999999999998, "text": " Now, when we design a learning algorithm, a key question is, how are we going to represent"}, {"start": 146.67999999999998, "end": 148.44, "text": " the function f?"}, {"start": 148.44, "end": 155.56, "text": " Or in other words, what is the math formula we're going to use to compute f?"}, {"start": 155.56, "end": 159.82, "text": " For now, let's stick with f being a straight line."}, {"start": 159.82, "end": 168.88, "text": " So your function can be written as f subscript w comma b of x equals, I'm going to use w"}, {"start": 168.88, "end": 172.35999999999999, "text": " times x plus b."}, {"start": 172.35999999999999, "end": 179.92, "text": " I'll define w and b soon, but for now, just know that w and b are numbers, and the values"}, {"start": 179.92, "end": 188.44, "text": " chosen for w and b will determine the prediction y hat based on the input feature x."}, {"start": 188.44, "end": 196.92, "text": " So this f w b of x means f is a function that takes x's input, and depending on the values"}, {"start": 196.92, "end": 204.26, "text": " of w and b, f will output some value of a prediction y hat."}, {"start": 204.26, "end": 212.4, "text": " As an alternative to writing this f w comma b of x, I'll sometimes just write f of x without"}, {"start": 212.4, "end": 215.68, "text": " explicitly including w and b in the subscript."}, {"start": 215.68, "end": 223.24, "text": " It's just a simple notation, but means exactly the same thing as f w b of x."}, {"start": 223.24, "end": 229.32, "text": " Let's plot the training set on the graph where the input feature x is on the horizontal axis,"}, {"start": 229.32, "end": 233.84, "text": " and the output target y is on the vertical axis."}, {"start": 233.84, "end": 240.84, "text": " Remember, the algorithm learns from this data and generates a best fit line like maybe this"}, {"start": 240.84, "end": 242.54000000000002, "text": " one here."}, {"start": 242.54, "end": 252.16, "text": " This straight line is the linear function f w b of x equals w times x plus b."}, {"start": 252.16, "end": 260.84, "text": " Or more simply, we can drop w and b and just write f of x equals w x plus b."}, {"start": 260.84, "end": 266.76, "text": " Here's what this function is doing, it's making predictions for the value of y using a straight"}, {"start": 266.76, "end": 268.68, "text": " line function of x."}, {"start": 268.68, "end": 274.54, "text": " So you may ask, why are we choosing a linear function where linear function is just a fancy"}, {"start": 274.54, "end": 280.84000000000003, "text": " term for a straight line, instead of some nonlinear function like a curve or a parabola?"}, {"start": 280.84000000000003, "end": 286.52, "text": " Well, sometimes you want to fit more complex nonlinear functions as well, like a curve"}, {"start": 286.52, "end": 292.16, "text": " like this, but since this linear function is relatively simple and easy to work with,"}, {"start": 292.16, "end": 297.18, "text": " let's use a line as a foundation that will eventually help you to get to more complex"}, {"start": 297.18, "end": 300.44, "text": " models that are nonlinear."}, {"start": 300.44, "end": 304.76, "text": " This particular model has a name, it's called linear regression."}, {"start": 304.76, "end": 310.72, "text": " More specifically, this is linear regression with one variable, where the phrase one variable"}, {"start": 310.72, "end": 317.72, "text": " means that there's a single input variable or feature x, namely the size of the house."}, {"start": 317.72, "end": 324.16, "text": " Another name for a linear model with one input variable is univariate linear regression,"}, {"start": 324.16, "end": 329.8, "text": " where uni means one in Latin and where variate means variable."}, {"start": 329.8, "end": 334.8, "text": " So univariate is just a fancy way of saying one variable."}, {"start": 334.8, "end": 340.56, "text": " In a later video, you'll also see a variation of regression where you want to make a prediction"}, {"start": 340.56, "end": 345.52000000000004, "text": " based not just on the size of a house, but on a bunch of other things that you may know"}, {"start": 345.52000000000004, "end": 349.20000000000005, "text": " about the house, such as number of bedrooms and other features."}, {"start": 349.20000000000005, "end": 353.92, "text": " And by the way, when you're done with this video, there is another optional lab."}, {"start": 353.92, "end": 358.92, "text": " You don't need to write any code, just review it, run the code and see what it does."}, {"start": 358.92, "end": 363.6, "text": " That will show you how to define in Python a straight line function."}, {"start": 363.6, "end": 370.56, "text": " And the lab will let you choose the values of W and B to try to fit the training data."}, {"start": 370.56, "end": 374.52000000000004, "text": " You don't have to do the lab if you don't want to, but I hope you play of it when you're"}, {"start": 374.52000000000004, "end": 377.20000000000005, "text": " done watching this video."}, {"start": 377.20000000000005, "end": 379.34000000000003, "text": " So that's linear regression."}, {"start": 379.34000000000003, "end": 382.96000000000004, "text": " In order for you to make this work, one of the most important things you have to do is"}, {"start": 382.96, "end": 385.47999999999996, "text": " construct a cost function."}, {"start": 385.47999999999996, "end": 390.28, "text": " The idea of a cost function is one of the most universal and important ideas in machine"}, {"start": 390.28, "end": 395.91999999999996, "text": " learning and is used in both linear regression and in training many of the most advanced"}, {"start": 395.91999999999996, "end": 397.79999999999995, "text": " AI models in the world."}, {"start": 397.8, "end": 414.6, "text": " So let's go on to the next video and take a look at how you can construct a cost function."}]
Machine Learning Specialization 2022 -- Andrew Ng, Stanford University.
https://www.youtube.com/watch?v=ZzeDtSmrRoU
1.11 Machine Learning Overview | Cost function formula --[Machine Learning | Andrew Ng]
First Course: Supervised Machine Learning : Regression and Classification. If you liked the content please subscribe and put a little blue thumb. Take heart!
In order to implement linear regression, the first key step is for us to define something called a cost function. This is something we'll build in this video. And the cost function will tell us how well the model is doing so that we can try to get it to do better. Let's look at what this means. Recall that you have a training set that contains input features x and output targets y. And the model you're going to use to fit this training set is this linear function fwb of x equals w times x plus b. To introduce a little bit more terminology, the w and b are called the parameters of the model. In machine learning, parameters of a model are the variables you can adjust during training in order to improve the model. Sometimes, you also hear the parameters w and b referred to as coefficients or as weights. Now, let's take a look at what these parameters w and b do. Depending on the values you've chosen for w and b, you get a different function f of x, which generates a different line on the graph. And remember that we can write f of x as a shorthand for fwb of x. We're going to take a look at some plots of f of x on a chart. Maybe you're already familiar with drawing lines on charts, but even if this is a review for you, I hope this will help you build intuition on how w and b, the parameters, determine f. When w is equal to 0 and b is equal to 1.5, then f looks like this horizontal line. In this case, the function f of x is 0 times x plus 1.5, so f is always a constant value. It always predicts 1.5 for the estimated value of y. So y hat is always equal to b. And here, b is also called the y-intercept, because that's where it crosses the vertical axis or the y-axis on this graph. As a second example, if w is 0.5 and b is equal to 0, then f of x is 0.5 times x. When x is 0, the prediction is also 0. And when x is 2, then the prediction is 0.5 times 2, which is 1. So you get a line that looks like this. And notice that the slope is 0.5 divided by 1, so the value of w gives you the slope of the line, which is 0.5. And finally, if w equals 0.5 and b equals 1, then f of x is 0.5 times x plus 1. And when x is 0, then f of x equals b, which is 1, so the line intersects the vertical axis at b, the y-intercept. Also when x is 2, then f of x is 2, so the line looks like this. Again, the slope is 0.5 divided by 1, so the value of w gives you the slope, which is 0.5. Recall that you have a training set, like the one shown here, with linear regression, what you want to do is to choose values for the parameters w and b so that the straight line you get from the function f somehow fits the data well, like maybe this line shown here. And when I say that the line fits the data, visually you can think of this to mean that the line defined by f is roughly passing through or somewhat close to the training examples as compared to other possible lines that are not as close to these points. And just to remind you of some notation, a training example like this point here is defined by x super strip i, y super strip i, where y is the target. For a given input x i, the function f also makes a predicted value for y, and the value that it predicts for y is y hat i, shown here. For our choice of a model, f of x i is w times x i plus b. Stated differently, the prediction y hat i is f of w b of x i, where for the model where using f of x i is equal to w x i plus b. So now the question is, how do you find values for w and b so that the prediction y hat i is close to the true target y i for many or maybe all training examples x i y i? To answer that question, let's first take a look at how to measure how well a line fits the training data. To do that, we're going to construct our cost function. The cost function takes the prediction y hat and compares it to the target y by taking y hat minus y. This difference is called the error. We're measuring how far off the prediction is from the target. Next let's compute the square of this error. Also we're going to want to compute this term for different training examples i in the training set. So when measuring the error for example i, we'll compute this squared error term. Finally, we want to measure the error across the entire training set. In particular, let's sum up the squared errors like this. We'll sum from i equals 1, 2, 3, all the way up to m. And remember that m is the number of training examples, which is 47 for this data set. Notice that if we have more training examples, m is larger and your cost function will calculate a bigger number since it's summing over more examples. So to build a cost function that doesn't automatically get bigger as the training set size gets larger, by convention, we will compute the average squared error instead of the total squared error. And we do that by dividing by m like this. Okay, we're nearly there. Just one last thing. By convention, the cost function that machine learning people use actually divides by two times m. The extra division by two is just meant to make some of our later calculations a little bit neater. But the cost function still works whether you include this division by two or not. So this expression right here is the cost function. And we're going to write J of WB to refer to the cost function. This is also called the squared error cost function. And it's called this because you're taking the square of these error terms. In machine learning, different people will use different cost functions for different applications. But the squared error cost function is by far the most commonly used one for linear regression. And for that matter, for all regression problems, where it seems to give good results for many applications. So just as a reminder, the prediction y hat is equal to the output of the model f at x. So we can rewrite the cost function J of WB as one over two m times the sum from i equals one to m of f of x i minus y i, the quantity squared. Eventually, we're going to want to find values of W and B that make the cost function small. But before going there, let's first gain more intuition about what J of WB is really computing. At this point, you might be thinking we've done a whole lot of math to define the cost function. But what exactly is it doing? Let's go on to the next video, where we'll step through one example of what the cost function is really computing. That I hope will help you build intuition about what it means if J of WB is large versus if the cost J is small. Let's go on to the next video.
[{"start": 0.0, "end": 6.32, "text": " In order to implement linear regression, the first key step is for us to define something"}, {"start": 6.32, "end": 8.32, "text": " called a cost function."}, {"start": 8.32, "end": 10.8, "text": " This is something we'll build in this video."}, {"start": 10.8, "end": 16.04, "text": " And the cost function will tell us how well the model is doing so that we can try to get"}, {"start": 16.04, "end": 17.68, "text": " it to do better."}, {"start": 17.68, "end": 19.68, "text": " Let's look at what this means."}, {"start": 19.68, "end": 26.6, "text": " Recall that you have a training set that contains input features x and output targets y."}, {"start": 26.6, "end": 33.68, "text": " And the model you're going to use to fit this training set is this linear function fwb of"}, {"start": 33.68, "end": 37.32, "text": " x equals w times x plus b."}, {"start": 37.32, "end": 43.480000000000004, "text": " To introduce a little bit more terminology, the w and b are called the parameters of the"}, {"start": 43.480000000000004, "end": 44.88, "text": " model."}, {"start": 44.88, "end": 51.08, "text": " In machine learning, parameters of a model are the variables you can adjust during training"}, {"start": 51.08, "end": 53.84, "text": " in order to improve the model."}, {"start": 53.84, "end": 61.64, "text": " Sometimes, you also hear the parameters w and b referred to as coefficients or as weights."}, {"start": 61.64, "end": 68.28, "text": " Now, let's take a look at what these parameters w and b do."}, {"start": 68.28, "end": 73.56, "text": " Depending on the values you've chosen for w and b, you get a different function f of"}, {"start": 73.56, "end": 77.56, "text": " x, which generates a different line on the graph."}, {"start": 77.56, "end": 84.84, "text": " And remember that we can write f of x as a shorthand for fwb of x."}, {"start": 84.84, "end": 90.0, "text": " We're going to take a look at some plots of f of x on a chart."}, {"start": 90.0, "end": 94.18, "text": " Maybe you're already familiar with drawing lines on charts, but even if this is a review"}, {"start": 94.18, "end": 100.4, "text": " for you, I hope this will help you build intuition on how w and b, the parameters, determine"}, {"start": 100.4, "end": 102.72, "text": " f."}, {"start": 102.72, "end": 111.0, "text": " When w is equal to 0 and b is equal to 1.5, then f looks like this horizontal line."}, {"start": 111.0, "end": 120.6, "text": " In this case, the function f of x is 0 times x plus 1.5, so f is always a constant value."}, {"start": 120.6, "end": 125.75999999999999, "text": " It always predicts 1.5 for the estimated value of y."}, {"start": 125.75999999999999, "end": 129.12, "text": " So y hat is always equal to b."}, {"start": 129.12, "end": 134.72, "text": " And here, b is also called the y-intercept, because that's where it crosses the vertical"}, {"start": 134.72, "end": 138.72, "text": " axis or the y-axis on this graph."}, {"start": 138.72, "end": 148.96, "text": " As a second example, if w is 0.5 and b is equal to 0, then f of x is 0.5 times x."}, {"start": 148.96, "end": 152.56, "text": " When x is 0, the prediction is also 0."}, {"start": 152.56, "end": 158.52, "text": " And when x is 2, then the prediction is 0.5 times 2, which is 1."}, {"start": 158.52, "end": 160.88000000000002, "text": " So you get a line that looks like this."}, {"start": 160.88000000000002, "end": 169.56, "text": " And notice that the slope is 0.5 divided by 1, so the value of w gives you the slope of"}, {"start": 169.56, "end": 173.44, "text": " the line, which is 0.5."}, {"start": 173.44, "end": 184.68, "text": " And finally, if w equals 0.5 and b equals 1, then f of x is 0.5 times x plus 1."}, {"start": 184.68, "end": 191.72, "text": " And when x is 0, then f of x equals b, which is 1, so the line intersects the vertical"}, {"start": 191.72, "end": 195.16, "text": " axis at b, the y-intercept."}, {"start": 195.16, "end": 201.04000000000002, "text": " Also when x is 2, then f of x is 2, so the line looks like this."}, {"start": 201.04000000000002, "end": 209.4, "text": " Again, the slope is 0.5 divided by 1, so the value of w gives you the slope, which is 0.5."}, {"start": 209.4, "end": 215.36, "text": " Recall that you have a training set, like the one shown here, with linear regression,"}, {"start": 215.36, "end": 220.32, "text": " what you want to do is to choose values for the parameters w and b so that the straight"}, {"start": 220.32, "end": 225.88, "text": " line you get from the function f somehow fits the data well, like maybe this line shown"}, {"start": 225.88, "end": 227.28, "text": " here."}, {"start": 227.28, "end": 232.76, "text": " And when I say that the line fits the data, visually you can think of this to mean that"}, {"start": 232.76, "end": 239.88, "text": " the line defined by f is roughly passing through or somewhat close to the training examples"}, {"start": 239.88, "end": 245.79999999999998, "text": " as compared to other possible lines that are not as close to these points."}, {"start": 245.79999999999998, "end": 252.84, "text": " And just to remind you of some notation, a training example like this point here is defined"}, {"start": 252.84, "end": 260.8, "text": " by x super strip i, y super strip i, where y is the target."}, {"start": 260.8, "end": 270.44, "text": " For a given input x i, the function f also makes a predicted value for y, and the value"}, {"start": 270.44, "end": 275.2, "text": " that it predicts for y is y hat i, shown here."}, {"start": 275.2, "end": 281.48, "text": " For our choice of a model, f of x i is w times x i plus b."}, {"start": 281.48, "end": 290.72, "text": " Stated differently, the prediction y hat i is f of w b of x i, where for the model where"}, {"start": 290.72, "end": 299.76000000000005, "text": " using f of x i is equal to w x i plus b."}, {"start": 299.76000000000005, "end": 307.76000000000005, "text": " So now the question is, how do you find values for w and b so that the prediction y hat i"}, {"start": 307.76000000000005, "end": 317.54, "text": " is close to the true target y i for many or maybe all training examples x i y i?"}, {"start": 317.54, "end": 323.08000000000004, "text": " To answer that question, let's first take a look at how to measure how well a line fits"}, {"start": 323.08000000000004, "end": 325.04, "text": " the training data."}, {"start": 325.04, "end": 329.08000000000004, "text": " To do that, we're going to construct our cost function."}, {"start": 329.08000000000004, "end": 336.8, "text": " The cost function takes the prediction y hat and compares it to the target y by taking"}, {"start": 336.8, "end": 339.90000000000003, "text": " y hat minus y."}, {"start": 339.90000000000003, "end": 342.96000000000004, "text": " This difference is called the error."}, {"start": 342.96, "end": 347.96, "text": " We're measuring how far off the prediction is from the target."}, {"start": 347.96, "end": 353.2, "text": " Next let's compute the square of this error."}, {"start": 353.2, "end": 358.24, "text": " Also we're going to want to compute this term for different training examples i in the training"}, {"start": 358.24, "end": 359.41999999999996, "text": " set."}, {"start": 359.41999999999996, "end": 365.59999999999997, "text": " So when measuring the error for example i, we'll compute this squared error term."}, {"start": 365.59999999999997, "end": 370.34, "text": " Finally, we want to measure the error across the entire training set."}, {"start": 370.34, "end": 374.11999999999995, "text": " In particular, let's sum up the squared errors like this."}, {"start": 374.11999999999995, "end": 380.28, "text": " We'll sum from i equals 1, 2, 3, all the way up to m."}, {"start": 380.28, "end": 386.28, "text": " And remember that m is the number of training examples, which is 47 for this data set."}, {"start": 386.28, "end": 391.88, "text": " Notice that if we have more training examples, m is larger and your cost function will calculate"}, {"start": 391.88, "end": 395.91999999999996, "text": " a bigger number since it's summing over more examples."}, {"start": 395.92, "end": 403.24, "text": " So to build a cost function that doesn't automatically get bigger as the training set size gets larger,"}, {"start": 403.24, "end": 409.52000000000004, "text": " by convention, we will compute the average squared error instead of the total squared"}, {"start": 409.52000000000004, "end": 410.52000000000004, "text": " error."}, {"start": 410.52000000000004, "end": 414.24, "text": " And we do that by dividing by m like this."}, {"start": 414.24, "end": 417.52000000000004, "text": " Okay, we're nearly there."}, {"start": 417.52000000000004, "end": 419.24, "text": " Just one last thing."}, {"start": 419.24, "end": 425.44, "text": " By convention, the cost function that machine learning people use actually divides by two"}, {"start": 425.44, "end": 426.64, "text": " times m."}, {"start": 426.64, "end": 431.71999999999997, "text": " The extra division by two is just meant to make some of our later calculations a little"}, {"start": 431.71999999999997, "end": 432.71999999999997, "text": " bit neater."}, {"start": 432.71999999999997, "end": 437.38, "text": " But the cost function still works whether you include this division by two or not."}, {"start": 437.38, "end": 440.68, "text": " So this expression right here is the cost function."}, {"start": 440.68, "end": 448.4, "text": " And we're going to write J of WB to refer to the cost function."}, {"start": 448.4, "end": 452.32, "text": " This is also called the squared error cost function."}, {"start": 452.32, "end": 457.44, "text": " And it's called this because you're taking the square of these error terms."}, {"start": 457.44, "end": 462.48, "text": " In machine learning, different people will use different cost functions for different"}, {"start": 462.48, "end": 463.48, "text": " applications."}, {"start": 463.48, "end": 468.71999999999997, "text": " But the squared error cost function is by far the most commonly used one for linear"}, {"start": 468.71999999999997, "end": 470.12, "text": " regression."}, {"start": 470.12, "end": 475.64, "text": " And for that matter, for all regression problems, where it seems to give good results for many"}, {"start": 475.64, "end": 476.8, "text": " applications."}, {"start": 476.8, "end": 485.72, "text": " So just as a reminder, the prediction y hat is equal to the output of the model f at x."}, {"start": 485.72, "end": 495.76, "text": " So we can rewrite the cost function J of WB as one over two m times the sum from i equals"}, {"start": 495.76, "end": 503.04, "text": " one to m of f of x i minus y i, the quantity squared."}, {"start": 503.04, "end": 510.36, "text": " Eventually, we're going to want to find values of W and B that make the cost function small."}, {"start": 510.36, "end": 518.64, "text": " But before going there, let's first gain more intuition about what J of WB is really computing."}, {"start": 518.64, "end": 523.28, "text": " At this point, you might be thinking we've done a whole lot of math to define the cost"}, {"start": 523.28, "end": 524.4, "text": " function."}, {"start": 524.4, "end": 526.88, "text": " But what exactly is it doing?"}, {"start": 526.88, "end": 531.8000000000001, "text": " Let's go on to the next video, where we'll step through one example of what the cost"}, {"start": 531.8, "end": 533.4, "text": " function is really computing."}, {"start": 533.4, "end": 539.4399999999999, "text": " That I hope will help you build intuition about what it means if J of WB is large versus"}, {"start": 539.4399999999999, "end": 542.04, "text": " if the cost J is small."}, {"start": 542.04, "end": 562.4399999999999, "text": " Let's go on to the next video."}]

Dataset Card for "mls"

More Information needed

Downloads last month
42
Edit dataset card