码迷,mamicode.com
首页 > 其他好文 > 详细

WEEK 1

时间:2018-12-03 15:38:24      阅读:106      评论:0      收藏:0      [点我收藏+]

标签:provided   bst   read   click   mini   name   topic   art   stat   

WEEK 1

1.1 Introduction

Welcome to Machine Learning! In this module, we introduce the core idea of teaching a computer to learn concepts using data—without being explicitly programmed. The Course Wiki is under construction. Please visit the resources tab for the most complete and up-to-date information.

5 videos, 9 readings

Video: Welcome to Machine Learning!

What is machine learning? You probably use it dozens of times a day without even knowing it. Each time you do a web search on Google or Bing, that works so well because their machine learning software has figured out how to rank what pages. When Facebook or Apple‘s photo application recognizes your friends in your pictures, that‘s also machine learning. Each time you read your email and a spam filter saves you from having to wade through tons of spam, again, that‘s because your computer has learned to distinguish spam from non-spam email. So, that‘s machine learning. There‘s a science of getting computers to learn without being explicitly programmed. One of the research projects that I‘m working on is getting robots to tidy up the house. How do you go about doing that? Well what you can do is have the robot watch you demonstrate the task and learn from that. The robot can then watch what objects you pick up and where to put them and try to do the same thing even when you aren‘t there. For me, one of the reasons I‘m excited about this is the AI, or artificial intelligence problem. Building truly intelligent machines, we can do just about anything that you or I can do. Many scientists think the best way to make progress on this is through learning algorithms called neural networks, which mimic how the human brain works, and I‘ll teach you about that, too. In this class, you learn about machine learning and get to implement them yourself. I hope you sign up on our website and join us.

Reading: Machine Learning Honor Code

Machine Learning Honor Code
We strongly encourage students to form study groups, and discuss the lecture videos (including in-video questions). We also encourage you to get together with friends to watch the videos together as a group. However, the answers that you submit for the review questions should be your own work. For the programming exercises, you are welcome to discuss them with other students, discuss specific algorithms, properties of algorithms, etc.; we ask only that you not look at any source code written by a different student, nor show your solution code to other students.

Guidelines for Posting Code in Discussion Forums
Scenario 1: Code to delete
Learner Question/Comment: "Here is the code I have so far, but it fails the grader. Please help me fix it."

Why Delete?: The reason is that if there is a simple fix provided by a student, a quick copy and paste with a small edit will provide credit without individual effort.

Learner Question: A student substitutes words for the math operators, but includes the variable names (or substitutes the equivalent greek letters (θ for ‘theta‘, etc). This student also provides a sentence-by-sentence, line by line, description of exactly what their code implements. "The first line of my script has the equation "hypothesis equals theta times X", but I get the following error message...".

Why Delete?: This should be deleted. “Spelling out” the code in English is the same as using the regular code.

Scenario 2: Code not to delete
Learner Question: How do I subset a matrix to eliminate the intercept?

Mentor Response: This probably would be okay, especially if the person posting makes an effort to not use familiar variable names, or to use a context which has nothing to do with the contexts in the assignments.

It is clearly ok to show examples of Octave code to demonstrate a technique. Even if the technique itself is directly applicable to a programming problem at hand. As long as what is typed cannot be "cut and pasted" into the program at hand.

E.g. how do I set column 1 of a matrix to zero? Try this in your Octave work area:

>> A = magic(3)

>> A(:,1) = 0

The above is always acceptable (in my understanding). Demonstrating techniques and learning the language/syntax are important Forum activities.

Video: Welcome

Welcome to this free online class on machine learning. Machine learning is one of the most exciting recent technologies. And in this class, you learn about the state of the art and also gain practice implementing and deploying these algorithms yourself. You‘ve probably use a learning algorithm dozens of times a day without knowing it. Every time you use a web search engine like Google or Bing to search the internet, one of the reasons that works so well is because a learning algorithm, one implemented by Google or Microsoft, has learned how to rank web pages. Every time you use Facebook or Apple‘s photo typing application and it recognizes your friends‘ photos, that‘s also machine learning. Every time you read your email and your spam filter saves you from having to wade through tons of spam email, that‘s also a learning algorithm. For me one of the reasons I‘m excited is the AI dream of someday building machines as intelligent as you or me. We‘re a long way away from that goal, but many AI researchers believe that the best way to towards that goal is through learning algorithms that try to mimic how the human brain learns. I‘ll tell you a little bit about that too in this class. In this class you learn about state-of-the-art machine learning algorithms. But it turns out just knowing the algorithms and knowing the math isn‘t that much good if you don‘t also know how to actually get this stuff to work on problems that you care about. So, we‘ve also spent a lot of time developing exercises for you to implement each of these algorithms and see how they work fot yourself. So why is machine learning so prevalent today? It turns out that machine learning is a field that had grown out of the field 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. But for the most part we just did not know how to write AI programs to do the more interesting things such as web search or photo tagging or email anti-spam. There was a realization that the only way to do these things was to have a machine learn to do it by itself. So, machine learning was developed as a new capability for computers and today it touches many segments of industry and basic science. For me, I work on machine learning and in a typical week I might end up talking to helicopter pilots, biologists, a bunch of computer systems people (so my colleagues here at Stanford) and averaging two or three times a week I get email from people in industry from Silicon Valley contacting me who have an interest in applying learning algorithms to their own problems. This is a sign of the range of problems that machine learning touches. There is autonomous robotics, computational biology, tons of things in Silicon Valley that machine learning is having an impact on. Here are some other examples of machine learning. There‘s database mining. One of the reasons machine learning has so pervaded is the growth of the web and the growth of automation All this means that we have much larger data sets than ever before. So, for example tons of Silicon Valley companies are today collecting web click data, also called clickstream data, and are trying to use machine learning algorithms to mine this data to understand the users better and to serve the users better, that‘s a huge segment of Silicon Valley right now. Medical records. With the advent of automation, we now have electronic medical records, so if we can turn medical records into medical knowledge, then we can start to understand disease better. Computational biology. With automation again, biologists are collecting lots of data about gene sequences, DNA sequences, and so on, and machines running algorithms are giving us a much better understanding of the human genome, and what it means to be human. And in engineering as well, in all fields of engineering, we have larger and larger, and larger and larger data sets, that we‘re trying to understand using learning algorithms. A second range of machinery applications is ones that we cannot program by hand. So for example, I‘ve worked on autonomous helicopters for many years. We just did not know how to write a computer program to make this helicopter fly by itself. The only thing that worked was having a computer learn by itself how to fly this helicopter. [Helicopter whirling]
4:37
Handwriting recognition. It turns out one of the reasons it‘s so inexpensive today to route a piece of mail across the countries, in the US and internationally, is that when you write an envelope like this, it turns out there‘s a learning algorithm that has learned how to read your handwriting so that it can automatically route this envelope on its way, and so it costs us a few cents to send this thing thousands of miles. And in fact if you‘ve seen the fields of natural language processing or computer vision, these are the fields of AI pertaining to understanding language or understanding images. Most of natural language processing and most of computer vision today is applied machine learning. Learning algorithms are also widely used for self- customizing programs. Every time you go to Amazon or Netflix or iTunes Genius, and it recommends the movies or products and music to you, that‘s a learning algorithm. If you think about it they have million users; there is no way to write a million different programs for your million users. The only way to have software give these customized recommendations is to become learn by itself to customize itself to your preferences. Finally learning algorithms are being used today to understand human learning and to understand the brain. We‘ll talk about how researches are using this to make progress towards the big AI dream. A few months ago, a student showed me an article on the top twelve IT skills. The skills that information technology hiring managers cannot say no to. It was a slightly older article, but at the top of this list of the twelve most desirable IT skills was machine learning. Here at Stanford, the number of recruiters that contact me asking if I know any graduating machine learning students is far larger than the machine learning students we graduate each year. So I think there is a vast, unfulfilled demand for this skill set, and this is a great time to be learning about machine learning, and I hope to teach you a lot about machine learning in this class. In the next video, we‘ll start to give 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‘ll 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.

Video: What is Machine Learning?

What is machine learning? In this video, we will try to define what it is and also try to give you a sense of when you want to use machine learning. Even among machine learning practitioners, there isn‘t a well accepted definition of what is and what isn‘t machine learning. But let me show you a couple of examples of the ways that people have tried to define it. Here‘s a definition of what is machine learning as due to Arthur Samuel. He defined machine learning as the field of study that gives computers the ability to learn without being explicitly learned.
0:33
Samuel‘s claim to fame was that back in the 1950, he wrote a checkers playing program and the amazing thing about this checkers playing program was that Arthur Samuel himself wasn‘t a very good checkers player. But what he did was he had to programmed maybe tens of thousands of games against himself, and by watching what sorts of board positions tended to lead to wins and what sort of board positions tended to lead to losses, the checkers playing program learned over time what are good board positions and what are bad board positions. And eventually learn to play checkers better than the Arthur Samuel himself was able to. This was a remarkable result. Arthur Samuel himself turns out not to be a very good checkers player. But because a computer has the patience to play tens of thousands of games against itself, no human has the patience to play that many games. By doing this, a computer was able to get so much checkers playing experience that it eventually became a better checkers player than Arthur himself.
1:32
This is a somewhat informal definition and an older one. Here‘s a slightly more recent definition by Tom Mitchell who‘s a friend of Carnegie Melon. So Tom defines machine learning by saying that a well-posed learning problem is defined as follows. He says, a computer program is said to learn from experience E with respect to some task T and some performance measure P, if its performance on T, as measured by P, improves with experience E. I actually think he came out with this definition just to make it rhyme. For the checkers playing examples, the experience E would be the experience of having the program play tens of thousands of games itself. The task T would be the task of playing checkers, and the performance measure P will be the probability that wins the next game of checkers against some new opponent.
2:24
Throughout these videos, besides me trying to teach you stuff, I‘ll occasionally ask you a question to make sure you understand the content. Here‘s one.
2:33
On top is a definition of machine learning by Tom Mitchell. Let‘s say your email program watches which emails you do or do not mark as spam. So in an email client like this, you might click the Spam button to report some email as spam but not other emails. And based on which emails you mark as spam, say your email program learns better how to filter spam email. What is the task T in this setting? In a few seconds, the video will pause and when it does so, you can use your mouse to select one of these four radio buttons to let me know which of these four you think is the right answer to this question.
3:16
So hopefully you got that this is the right answer, classifying emails is the task T. In fact, this definition defines a task T performance measure P and some experience E. And so, watching you label emails as spam or not spam, this would be the experience E and and the fraction of emails correctly classified, that might be a performance measure P. And so on the task of systems performance, on the performance measure P will improve after the experience E.
3:55
In this class, I hope to teach you about various different types of learning algorithms. There are several different types of learning algorithms. The main two types are what we call supervised learning and unsupervised learning. I‘ll define what these terms mean more in the next couple videos. It turns out that in supervised learning, the idea is we‘re going to teach the computer how to do something. Whereas in unsupervised learning, we‘re going to let it learn by itself. Don‘t worry if these two terms don‘t make sense yet. In the next two videos, I‘m going to say exactly what these two types of learning are. You might also hear other ghost terms such as reinforcement learning and recommender systems. These are other types of machine learning algorithms that we‘ll talk about later. But the two most use types of learning algorithms are probably supervised learning and unsupervised learning. And I‘ll define them in the next two videos and we‘ll spend most of this class talking about these two types of learning algorithms. It turns out what are the other things to spend a lot of time on in this class is practical advice for applying learning algorithms. This is something that I feel pretty strongly about. And exactly something that I don‘t know if any other university teachers. Teaching about learning algorithms is like giving a set of tools. And equally important or more important than giving you the tools as they teach you how to apply these tools. I like to make an analogy to learning to become a carpenter. Imagine that someone is teaching you how to be a carpenter, and they say, here‘s a hammer, here‘s a screwdriver, here‘s a saw, good luck. Well, that‘s no good. You have all these tools but the more important thing is to learn how to use these tools properly.
5:36
There‘s a huge difference between people that know how to use these machine learning algorithms, versus people that don‘t know how to use these tools well. Here, in Silicon Valley where I live, when I go visit different companies even at the top Silicon Valley companies, very often I see people trying to apply machine learning algorithms to some problem and sometimes they have been going at for six months. But sometimes when I look at what their doing, I say, I could have told them like, gee, I could have told you six months ago that you should be taking a learning algorithm and applying it in like the slightly modified way and your chance of success will have been much higher. So what we‘re going to do in this class is actually spend a lot of the time talking about how if you‘re actually trying to develop a machine learning system, how to make those best practices type decisions about the way in which you build your system. So that when you‘re finally learning algorithim, you‘re less likely to end up one of those people who end up persuing something after six months that someone else could have figured out just a waste of time for six months. So I‘m actually going to spend a lot of time teaching you those sorts of best practices in machine learning and AI and how to get the stuff to work and how the best people do it in Silicon Valley and around the world. I hope to make you one of the best people in knowing how to design and build serious machine learning and AI systems. So that‘s machine learning, and these are the main topics I hope to teach. In the next video, I‘m going to define what is supervised learning and after that what is unsupervised learning. And also time to talk about when you would use each of them.

Reading: What is Machine Learning?

What is Machine Learning?
Two definitions of Machine Learning are offered. Arthur Samuel described it as: "the field of study that gives computers the ability to learn without being explicitly programmed." This is an older, informal definition.

Tom Mitchell provides a more modern definition: "A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E."

Example: playing checkers.

E = the experience of playing many games of checkers

T = the task of playing checkers.

P = the probability that the program will win the next game.

In general, any machine learning problem can be assigned to one of two broad classifications:

Supervised learning and Unsupervised learning.

Reading: How to Use Discussion Forums

pass

Video: Supervised Learning

In this video, I‘m going to define what is probably the most common type of Machine Learning problem, which is Supervised Learning. I‘ll define Supervised Learning more formally later, but it‘s probably best to explain or start with an example of what it is, and we‘ll do the formal definition later. Let‘s say you want to predict housing prices. A while back a student collected data sets from the City of Portland, Oregon, and let‘s say you plot the data set and it looks like this. Here on the horizontal axis, the size of different houses in square feet, and on the vertical axis, the price of different houses in thousands of dollars. So, given this data, let‘s say you have a friend who owns a house that is say 750 square feet, and they are hoping to sell the house, and they want to know how much they can get for the house. So, how can the learning algorithm help you? One thing a learning algorithm might be want to do is put a straight line through the data, also fit a straight line to the data. Based on that, it looks like maybe their house can be sold for maybe about \$150,000. But maybe this isn‘t the only learning algorithm you can use, and there might be a better one. For example, instead of fitting a straight line to the data, we might decide that it‘s better to fit a quadratic function, or a second-order polynomial to this data. If you do that and make a prediction here, then it looks like, well, maybe they can sell the house for closer to \$200,000. One of the things we‘ll talk about later is how to choose, and how to decide, do you want to fit a straight line to the data? Or do you want to fit a quadratic function to the data? There‘s no fair picking whichever one gives your friend the better house to sell. But each of these would be a fine example of a learning algorithm. So, this is an example of a Supervised Learning algorithm. The term Supervised Learning refers to the fact that we gave the algorithm a data set in which the, called, "right answers" were given. That is we gave it a data set of houses in which for every example in this data set, we told it what is the right price. So, what was the actual price that that house sold for, and the task of the algorithm was to just produce more of these right answers such as for this new house that your friend may be trying to sell. To define a bit more terminology, this is also called a regression problem. By regression problem, I mean we‘re trying to predict a continuous valued output. Namely the price. So technically, I guess prices can be rounded off to the nearest cent. So, maybe prices are actually discrete value. But usually, we think of the price of a house as a real number, as a scalar value, as a continuous value number, and the term regression refers to the fact that we‘re trying to predict the sort of continuous values attribute. Here‘s another Supervised Learning examples. Some friends and I were actually working on this earlier. Let‘s say you want to look at medical records and try to predict of a breast cancer as malignant or benign. If someone discovers a breast tumor, a lump in their breast, a malignant tumor is a tumor that is harmful and dangerous, and a benign tumor is a tumor that is harmless. So obviously, people care a lot about this. Let‘s see collected data set. Suppose you are in your dataset, you have on your horizontal axis the size of the tumor, and on the vertical axis, I‘m going to plot one or zero, yes or no, whether or not these are examples of tumors we‘ve seen before are malignant, which is one, or zero or not malignant or benign. So, let‘s say your dataset looks like this, where we saw a tumor of this size that turned out to be benign, one of this size, one of this size, and so on. Sadly, we also saw a few malignant tumors cell, one of that size, one of that size, one of that size, so on. So in this example, I have five examples of benign tumors shown down here, and five examples of malignant tumors shown with a vertical axis value of one. Let‘s say a friend who tragically has a breast tumor, and let‘s say her breast tumor size is maybe somewhere around this value, the Machine Learning question is, can you estimate what is the probability, what‘s the chance that a tumor as malignant versus benign? To introduce a bit more terminology, this is an example of a classification problem. The term classification refers to the fact, that here, we‘re trying to predict a discrete value output zero or one, malignant or benign. It turns out that in classification problems, sometimes you can have more than two possible values for the output. As a concrete example, maybe there are three types of breast cancers. So, you may try to predict a discrete value output zero, one, two, or three, where zero may mean benign, benign tumor, so no cancer, and one may mean type one cancer, maybe three types of cancer, whatever type one means, and two mean a second type of cancer, and three may mean a third type of cancer. But this will also be a classification problem because this are the discrete value set of output corresponding to you‘re no cancer, or cancer type one, or cancer type two, or cancer types three. In classification problems, there is another way to plot this data. Let me show you what I mean. I‘m going to use a slightly different set of symbols to plot this data. So, if tumor size is going to be the attribute that I‘m going to use to predict malignancy or benignness, I can also draw my data like this. I‘m going to use different symbols to denote my benign and malignant, or my negative and positive examples. So, instead of drawing crosses, I‘m now going to draw O‘s for the benign tumors, like so, and I‘m going to keep using X‘s to denote my malignant tumors. I hope this figure makes sense. All I did was I took my data set on top, and I just mapped it down to this real line like so, and started to use different symbols, circles and crosses to denote malignant versus benign examples. Now, in this example, we use only one feature or one attribute, namely the tumor size in order to predict whether a tumor is malignant or benign. In other machine learning problems, when we have more than one feature or more than one attribute. Here‘s an example, let‘s say that instead of just knowing the tumor size, we know both the age of the patients and the tumor size. In that case, maybe your data set would look like this, where I may have a set of patients with those ages, and that tumor size, and they look like this, and different set of patients that look a little different, whose tumors turn out to be malignant as denoted by the crosses. So, let‘s say you have a friend who tragically has a tumor, and maybe their tumor size and age falls around there. So, given a data set like this, what the learning algorithm might do is fit a straight line to the data to try to separate out the malignant tumors from the benign ones, and so the learning algorithm may decide to put a straight line like that to separate out the two causes of tumors. With this, hopefully we can decide that your friend‘s tumor is more likely, if it‘s over there that hopefully your learning algorithm will say that your friend‘s tumor falls on this benign side and is therefore more likely to be benign than malignant. In this example, we had two features namely, the age of the patient and the size of the tumor. In other Machine Learning problems, we will often have more features. My friends that worked on this problem actually used other features like these, which is clump thickness, clump thickness of the breast tumor, uniformity of cell size of the tumor, uniformity of cell shape the tumor, and so on, and other features as well. It turns out one of the most interesting learning algorithms that we‘ll see in this course, as the learning algorithm that can deal with not just two, or three, or five features, but an infinite number of features. On this slide, I‘ve listed a total of five different features. Two on the axis and three more up here. But it turns out that for some learning problems what you really want is not to use like three or five features, but instead you want to use an infinite number of features, an infinite number of attributes, so that your learning algorithm has lots of attributes, or features, or cues with which to make those predictions. So, how do you deal with an infinite number of features? How do you even store an infinite number of things in the computer when your computer is going to run out of memory? It turns out that when we talk about an algorithm called the Support Vector Machine, there will be a neat mathematical trick that will allow a computer to deal with an infinite number of features. Imagine that I didn‘t just write down two features here and three features on the right, but imagine that I wrote down an infinitely long list. I just kept writing more and more features, like an infinitely long list of features. It turns out we will come up with an algorithm that can deal with that. So, just to recap, in this course, we‘ll talk about Supervised Learning, and the idea is that in Supervised Learning, in every example in our data set, we are told what is the correct answer that we would have quite liked the algorithms have predicted on that example. Such as the price of the house, or whether a tumor is malignant or benign. We also talked about the regression problem, and by regression that means that our goal is to predict a continuous valued output. We talked about the classification problem where the goal is to predict a discrete value output. Just a quick wrap up question. Suppose you‘re running a company and you want to develop learning algorithms to address each of two problems. In the first problem, you have a large inventory of identical items. So, imagine that you have thousands of copies of some identical items to sell, and you want to predict how many of these items you sell over the next three months. In the second problem, problem two, you have lots of users, and you want to write software to examine each individual of your customer‘s accounts, so each one of your customer‘s accounts. For each account, decide whether or not the account has been hacked or compromised. So, for each of these problems, should they be treated as a classification problem or as a regression problem? When the video pauses, please use your mouse to select whichever of these four options on the left you think is the correct answer.
11:19
So hopefully, you got that. This is the answer. For problem one, I would treat this as a regression problem because if I have thousands of items, well, I would probably just treat this as a real value, as a continuous value. Therefore, the number of items I sell as a continuous value. For the second problem, I would treat that as a classification problem, because I might say set the value I want to predict with zero to denote the account has not been hacked, and set the value one to denote an account that has been hacked into. So, just like your breast cancers where zero is benign, one is malignant. So, I might set this be zero or one depending on whether it‘s been hacked, and have an algorithm try to predict each one of these two discrete values. Because there‘s a small number of discrete values, I would therefore treat it as a classification problem. So, that‘s it for Supervised Learning. In the next video, I‘ll talk about Unsupervised Learning, which is the other major category of learning algorithm.

Reading: Supervised Learning

Supervised Learning
In supervised learning, we are given a data set and already know what our correct output should look like, having the idea that there is a relationship between the input and the output.

Supervised learning problems are categorized into "regression" and "classification" problems. In a regression problem, we are trying to predict results within a continuous output, meaning that we are trying to map input variables to some continuous function. In a classification problem, we are instead trying to predict results in a discrete output. In other words, we are trying to map input variables into discrete categories.

Example 1:

Given data about the size of houses on the real estate market, try to predict their price. Price as a function of size is a continuous output, so this is a regression problem.

We could turn this example into a classification problem by instead making our output about whether the house "sells for more or less than the asking price." Here we are classifying the houses based on price into two discrete categories.

Example 2:

(a) Regression - Given a picture of a person, we have to predict their age on the basis of the given picture

(b) Classification - Given a patient with a tumor, we have to predict whether the tumor is malignant or benign.

Video: Unsupervised Learning

In this video, we‘ll talk about the second major type of machine learning problem, called Unsupervised Learning.
0:06
In the last video, we talked about Supervised Learning. Back then, recall data sets that look like this, where each example was labeled either as a positive or negative example, whether it was a benign or a malignant tumor.
0:20
So for each example in Supervised Learning, we were told explicitly what is the so-called right answer, whether it‘s benign or malignant. In Unsupervised Learning, we‘re given data that looks different than data that looks like this that doesn‘t have any labels or that all has the same label or really no labels.
0:39
So we‘re given the data set and we‘re not told what to do with it and we‘re not told what each data point is. Instead we‘re just told, here is a data set. Can you find some structure in the data? Given this data set, an Unsupervised Learning algorithm might decide that the data lives in two different clusters. And so there‘s one cluster
0:59
and there‘s a different cluster.
1:01
And yes, Supervised Learning algorithm may break these data into these two separate clusters.
1:06
So this is called a clustering algorithm. And this turns out to be used in many places.
1:11
One example where clustering is used is in Google News and if you have not seen this before, you can actually go to this URL news.google.com to take a look. What Google News does is everyday it goes and looks at tens of thousands or hundreds of thousands of new stories on the web and it groups them into cohesive news stories.
1:30
For example, let‘s look here.
1:33
The URLs here link to different news stories about the BP Oil Well story.
1:41
So, let‘s click on one of these URL‘s and we‘ll click on one of these URL‘s. What I‘ll get to is a web page like this. Here‘s a Wall Street Journal article about, you know, the BP Oil Well Spill stories of "BP Kills Macondo", which is a name of the spill and if you click on a different URL
2:00
from that group then you might get the different story. Here‘s the CNN story about a game, the BP Oil Spill,
2:07
and if you click on yet a third link, then you might get a different story. Here‘s the UK Guardian story about the BP Oil Spill.
2:16
So what Google News has done is look for tens of thousands of news stories and automatically cluster them together. So, the news stories that are all about the same topic get displayed together. It turns out that clustering algorithms and Unsupervised Learning algorithms are used in many other problems as well.
2:35
Here‘s one on understanding genomics.
2:38
Here‘s an example of DNA microarray data. The idea is put a group of different individuals and for each of them, you measure how much they do or do not have a certain gene. Technically you measure how much certain genes are expressed. So these colors, red, green, gray and so on, they show the degree to which different individuals do or do not have a specific gene.
3:02
And what you can do is then run a clustering algorithm to group individuals into different categories or into different types of people.
3:10
So this is Unsupervised Learning because we‘re not telling the algorithm in advance that these are type 1 people, those are type 2 persons, those are type 3 persons and so on and instead what were saying is yeah here‘s a bunch of data. I don‘t know what‘s in this data. I don‘t know who‘s and what type. I don‘t even know what the different types of people are, but can you automatically find structure in the data from the you automatically cluster the individuals into these types that I don‘t know in advance? Because we‘re not giving the algorithm the right answer for the examples in my data set, this is Unsupervised Learning.
3:44
Unsupervised Learning or clustering is used for a bunch of other applications.
3:48
It‘s used to organize large computer clusters.
3:51
I had some friends looking at large data centers, that is large computer clusters and trying to figure out which machines tend to work together and if you can put those machines together, you can make your data center work more efficiently.
4:04
This second application is on social network analysis.
4:07
So given knowledge about which friends you email the most or given your Facebook friends or your Google+ circles, can we automatically identify which are cohesive groups of friends, also which are groups of people that all know each other?
4:22
Market segmentation.
4:24
Many companies have huge databases of customer information. So, can you look at this customer data set and automatically discover market segments and automatically
4:33
group your customers into different market segments so that you can automatically and more efficiently sell or market your different market segments together?
4:44
Again, this is Unsupervised Learning because we have all this customer data, but we don‘t know in advance what are the market segments and for the customers in our data set, you know, we don‘t know in advance who is in market segment one, who is in market segment two, and so on. But we have to let the algorithm discover all this just from the data.
5:01
Finally, it turns out that Unsupervised Learning is also used for surprisingly astronomical data analysis and these clustering algorithms gives surprisingly interesting useful theories of how galaxies are formed. All of these are examples of clustering, which is just one type of Unsupervised Learning. Let me tell you about another one. I‘m gonna tell you about the cocktail party problem.
5:26
So, you‘ve been to cocktail parties before, right? Well, you can imagine there‘s a party, room full of people, all sitting around, all talking at the same time and there are all these overlapping voices because everyone is talking at the same time, and it is almost hard to hear the person in front of you. So maybe at a cocktail party with two people,
5:45
two people talking at the same time, and it‘s a somewhat small cocktail party. And we‘re going to put two microphones in the room so there are microphones, and because these microphones are at two different distances from the speakers, each microphone records a different combination of these two speaker voices.
6:05
Maybe speaker one is a little louder in microphone one and maybe speaker two is a little bit louder on microphone 2 because the 2 microphones are at different positions relative to the 2 speakers, but each microphone would cause an overlapping combination of both speakers‘ voices.
6:23
So here‘s an actual recording
6:26
of two speakers recorded by a researcher. Let me play for you the first, what the first microphone sounds like. One (uno), two (dos), three (tres), four (cuatro), five (cinco), six (seis), seven (siete), eight (ocho), nine (nueve), ten (y diez).
6:41
All right, maybe not the most interesting cocktail party, there‘s two people counting from one to ten in two languages but you know. What you just heard was the first microphone recording, here‘s the second recording.
6:57
Uno (one), dos (two), tres (three), cuatro (four), cinco (five), seis (six), siete (seven), ocho (eight), nueve (nine) y diez (ten). So we can do, is take these two microphone recorders and give them to an Unsupervised Learning algorithm called the cocktail party algorithm, and tell the algorithm - find structure in this data for you. And what the algorithm will do is listen to these audio recordings and say, you know it sounds like the two audio recordings are being added together or that have being summed together to produce these recordings that we had. Moreover, what the cocktail party algorithm will do is separate out these two audio sources that were being added or being summed together to form other recordings and, in fact, here‘s the first output of the cocktail party algorithm.
7:39
One, two, three, four, five, six, seven, eight, nine, ten.
7:47
So, I separated out the English voice in one of the recordings.
7:52
And here‘s the second of it. Uno, dos, tres, quatro, cinco, seis, siete, ocho, nueve y diez. Not too bad, to give you
8:03
one more example, here‘s another recording of another similar situation, here‘s the first microphone : One, two, three, four, five, six, seven, eight, nine, ten.
8:16
OK so the poor guy‘s gone home from the cocktail party and he ‘s now sitting in a room by himself talking to his radio.
8:23
Here‘s the second microphone recording.
8:28
One, two, three, four, five, six, seven, eight, nine, ten.
8:33
When you give these two microphone recordings to the same algorithm, what it does, is again say, you know, it sounds like there are two audio sources, and moreover,
8:42
the album says, here is the first of the audio sources I found.
8:47
One, two, three, four, five, six, seven, eight, nine, ten.
8:54
So that wasn‘t perfect, it got the voice, but it also got a little bit of the music in there. Then here‘s the second output to the algorithm.
9:10
Not too bad, in that second output it managed to get rid of the voice entirely. And just, you know, cleaned up the music, got rid of the counting from one to ten.
9:18
So you might look at an Unsupervised Learning algorithm like this and ask how complicated this is to implement this, right? It seems like in order to, you know, build this application, it seems like to do this audio processing you need to write a ton of code or maybe link into like a bunch of synthesizer Java libraries that process audio, seems like a really complicated program, to do this audio, separating out audio and so on.
9:42
It turns out the algorithm, to do what you just heard, that can be done with one line of code - shown right here.
9:50
It take researchers a long time to come up with this line of code. I‘m not saying this is an easy problem, But it turns out that when you use the right programming environment, many learning algorithms can be really short programs.
10:03
So this is also why in this class we‘re going to use the Octave programming environment.
10:08
Octave, is free open source software, and using a tool like Octave or Matlab, many learning algorithms become just a few lines of code to implement. Later in this class, I‘ll just teach you a little bit about how to use Octave and you‘ll be implementing some of these algorithms in Octave. Or if you have Matlab you can use that too.
10:27
It turns out the Silicon Valley, for a lot of machine learning algorithms, what we do is first prototype our software in Octave because software in Octave makes it incredibly fast to implement these learning algorithms.
10:38
Here each of these functions like for example the SVD function that stands for singular value decomposition; but that turns out to be a linear algebra routine, that is just built into Octave.
10:49
If you were trying to do this in C++ or Java, this would be many many lines of code linking complex C++ or Java libraries. So, you can implement this stuff as C++ or Java or Python, it‘s just much more complicated to do so in those languages.
11:03
What I‘ve seen after having taught machine learning for almost a decade now, is that, you learn much faster if you use Octave as your programming environment, and if you use Octave as your learning tool and as your prototyping tool, it‘ll let you learn and prototype learning algorithms much more quickly.
11:22
And in fact what many people will do to in the large Silicon Valley companies is in fact, use an algorithm like Octave to first prototype the learning algorithm, and only after you‘ve gotten it to work, then you migrate it to C++ or Java or whatever. It turns out that by doing things this way, you can often get your algorithm to work much faster than if you were starting out in C++.
11:44
So, I know that as an instructor, I get to say "trust me on this one" only a finite number of times, but for those of you who‘ve never used these Octave type programming environments before, I am going to ask you to trust me on this one, and say that you, you will, I think your time, your development time is one of the most valuable resources.
12:04
And having seen lots of people do this, I think you as a machine learning researcher, or machine learning developer will be much more productive if you learn to start in prototype, to start in Octave, in some other language.
12:17
Finally, to wrap up this video, I have one quick review question for you.
12:24
We talked about Unsupervised Learning, which is a learning setting where you give the algorithm a ton of data and just ask it to find structure in the data for us. Of the following four examples, which ones, which of these four do you think would will be an Unsupervised Learning algorithm as opposed to Supervised Learning problem. For each of the four check boxes on the left, check the ones for which you think Unsupervised Learning algorithm would be appropriate and then click the button on the lower right to check your answer. So when the video pauses, please answer the question on the slide.
13:01
So, hopefully, you‘ve remembered the spam folder problem. If you have labeled data, you know, with spam and non-spam e-mail, we‘d treat this as a Supervised Learning problem.
13:11
The news story example, that‘s exactly the Google News example that we saw in this video, we saw how you can use a clustering algorithm to cluster these articles together so that‘s Unsupervised Learning.
13:23
The market segmentation example I talked a little bit earlier, you can do that as an Unsupervised Learning problem because I am just gonna get my algorithm data and ask it to discover market segments automatically.
13:35
And the final example, diabetes, well, that‘s actually just like our breast cancer example from the last video. Only instead of, you know, good and bad cancer tumors or benign or malignant tumors we instead have diabetes or not and so we will use that as a supervised, we will solve that as a Supervised Learning problem just like we did for the breast tumor data.
13:58
So, that‘s it for Unsupervised Learning and in the next video, we‘ll delve more into specific learning algorithms and start to talk about just how these algorithms work and how we can, how you can go about implementing them.

Reading: Unsupervised Learning

Unsupervised Learning
Unsupervised learning allows us to approach problems with little or no idea what our results should look like. We can derive structure from data where we don‘t necessarily know the effect of the variables.

We can derive this structure by clustering the data based on relationships among the variables in the data.

With unsupervised learning there is no feedback based on the prediction results.

Example:

Clustering: Take a collection of 1,000,000 different genes, and find a way to automatically group these genes into groups that are somehow similar or related by different variables, such as lifespan, location, roles, and so on.

Non-clustering: The "Cocktail Party Algorithm", allows you to find structure in a chaotic environment. (i.e. identifying individual voices and music from a mesh of sounds at a cocktail party).

Reading: Lecture Slides

Lecture1.pdf

1.2 Linear Regression with One Variable

Linear regression predicts a real-valued output based on an input value. We discuss the application of linear regression to housing price prediction, present the notion of a cost function, and introduce the gradient descent method for learning.
7 videos, 8 readings

1.2.1 Model and Cost Function

Video: Model Representation

Reading: Model Representation

Video: Cost Function

Reading: Cost Function

Video: Cost Function - Intuition I

Reading: Cost Function - Intuition I

Video: Cost Function - Intuition II

Reading: Cost Function - Intuition II

1.2.2 Parameter Learning

Video: Gradient Descent

Reading: Gradient Descent

Video: Gradient Descent Intuition

Reading: Gradient Descent Intuition

Video: Gradient Descent For Linear Regression

Reading: Gradient Descent For Linear Regression

Reading: Lecture Slides

1.3 Linear Algebra Review

This optional module provides a refresher on linear algebra concepts. Basic understanding of linear algebra is necessary for the rest of the course, especially as we begin to cover models with multiple variables.
6 videos, 7 readings, 1 practice quiz

Video: Matrices and Vectors

Reading: Matrices and Vectors

Video: Addition and Scalar Multiplication

Reading: Addition and Scalar Multiplication

Video: Matrix Vector Multiplication

Reading: Matrix Vector Multiplication

Video: Matrix Matrix Multiplication

Reading: Matrix Matrix Multiplication

Video: Matrix Multiplication Properties

Reading: Matrix Multiplication Properties

Video: Inverse and Transpose

Reading: Inverse and Transpose

Reading: Lecture Slides

WEEK 1

标签:provided   bst   read   click   mini   name   topic   art   stat   

原文地址:https://www.cnblogs.com/keyshaw/p/10058072.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!