Week1

Posted ForTech

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Week1相关的知识,希望对你有一定的参考价值。

 Welcome

 Welcome to Machine Learning!(video)

What is machine learning?

You probably use it dozens of times a day without even knowing it.
1.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.
2.When Facebook or Apple‘s photo application recognizes your friends in your pictures,
that‘s also machine learning.
3.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.

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.


 

Introduction

Welcome(video)

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.

1. There‘s database mining.

a. 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.

b. 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.

c. 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.

d. 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.

2. A second range of machinery applications is ones that we cannot program by hand.

a. 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]

b. 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.

c. Most of natural language processing and most of computer vision today is applied machine learning.

3. 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.

What is Machine Learning?(video)

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.

1. Here‘s the definition of what is machine learning does to Arthur Samuel.

He defined machine learning as the field of study that gives computers the ability to learn without being explicitly programmed.

Samuel‘s claim to fame was that back in the 1950‘s, 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 program for it to play 10‘s of 1000‘s of games against itself.

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 learns over time what are good board positions and what are bad board positions.

And eventually learn to play checkers better than Arthur Samuel himself was able to.

This was a remarkable result.

Although Samuel himself turned out not to be a very good checkers player.

But because the computer has the patience to play tens of thousands of games itself.

No human, has the patience to play that many games.

By doing this the computer was able to get so much checkers-playing experience that it eventually became a better checkers player than Arthur Samuel himself.

2. This is somewhat informal definition, and an older one.

Here‘s a slightly more recent definition by Tom Mitchell, who‘s a friend out of Carnegie Mellon.

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 up with this definition just to make it rhyme.

For the checkers playing example the experience e, will be the experience of having the program play 10‘s of 1000‘s of games against itself.

The task t, will be the task of playing checkers.

And the performance measure p, will be the probability that it wins the next game of checkers against some new opponent.

 

Throughout these videos, besides me trying to teach you stuff, I will occasionally ask you a question to make sure you understand the content.

Here‘s one, 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 flag as spam.

So in an email client like this you might click this spam button to report some email as spam, but not other emails and.

Based on which emails you mark as spam, so your e-mail program learns better how to filter spam e-mail.

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, to let me know which of these four you think is the right answer to this question.

That might be a performance measure P.

And so, our task performance on the task our system‘s performance on the task T, on the performance measure P will improve after the experience E.

 

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.

But it turns out that in supervised learning, the idea is that we‘re going to teach the computer how to do something, whereas in unsupervised learning we‘re going 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 will also hear other buzz 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 used 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 one of the other things we‘ll 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 it‘s actually something that I don‘t know of any other university teaches.

Teaching about learning algorithms is like giving you a set of tools, and equally important or more important to giving you the tools is toteach 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, right?

You, you, you have all these tools, but the more important thing, is to learn how to use these tools properly.

There‘s a huge difference between, between people that know how to use these machines learning algorithms, versus people who 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 are trying to apply machine learning algorithms to some problem and sometimes they have been going at it for six months.

But sometimes when I look at what they‘re doing I, I, I say, you know, 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 would have been much higher.

So what we‘re going to do in this class is actually spend a lot of time talking about how, if you actually tried 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 applying learning algorithm you‘re less likely to end up one of those people who end up pursuing some path for six months that, you know, someone else could have figured out it just wasn‘t gonna work at all and it‘s just a waste of time for six months.

So I‘m actually going to spend a lot of the time teaching you those sorts of best practices in machine learning and AI and how to get this stuff to work and how we do it, 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, start to talk about when you would use each of them.

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.

 

How to Use Discussion Forums

 

How to Use Discussion Forums

 

Upvoting Posts

 

When you enter the discussion forum for your course, you will see an Upvote button under each post. We encourage you to upvote posts you find thoughtful, interesting, or helpful. This is the best way to ensure that quality posts will be seen by other learners in the course. Upvoting will also increase the likelihood that important questions get addressed and answered.

 

Report Abuse

 

Coursera‘s Code of Conduct prohibits:

 

  • Bullying or threatening other users
  • Posting spam or promotional content
  • Posting mature content
  • Posting assignment solutions (or other violations of the Honor Code)

 

Please report any posts that infringe upon copyright or are abusive, offensive, or that otherwise violate Coursera’s Honor Code by using the Report this option found under the menu arrow to the right of each post.

 

Following

 

If you find a particular thread interesting, click the Follow button under the original post of that thread page. When you follow a post, you will receive an email notification anytime a new post is made.

 

Improving Your Posts

 

Course discussion forums are your chance to interact with thousands of like-minded individuals around the world. Getting their attention is one way to do well in this course. In any social interaction, certain rules of etiquette are expected and contribute to more enjoyable and productive communication. The following are tips for interacting in this course via the forums, adapted from guidelines originally compiled by AHA! and Chuq Von Rospach & Gene Spafford:

 

  1. Stay on topic in existing forums and threads. Off-topic posts make it hard for other learners to find information they need. Post in the most appropriate forum for your topic, and do not post the same thing in multiple forums.
  2. Use the filters at the top of the forum page (Latest, Top, and Unanswered) to find active, interesting content.
  3. Upvote posts that are helpful and interesting.
  4. Be civil. If you disagree, explain your position with respect and refrain from any and all personal attacks.
  5. Stay on topic. In particular, don’t change the subject in the middle of an existing thread – just start a new topic.
  6. Make sure you’re understood, even by non-native English speakers. Try to write full sentences, and avoid text-message abbreviations or slang. Be careful when you use humor and sarcasm as these messages are easy to misinterpret.
  7. If asking a question, provide as much information as possible, what you’ve already considered, what you’ve already read, etc.
  8. Cite appropriate references when using someone else’s ideas, thoughts, or words.
  9. Do not use a forum to promote your product, service, or business.
  10. Conclude posts by inviting other learners to extend the discussion. For example, you could say “I would love to understand what others think.”
  11. Do not post personal information about other posters in the forum.
  12. Report spammers.

 

For more details, refer to Coursera‘s Forum Code of Conduct.

 

These tips and tools for interacting in this course via the forums were adapted from guidelines originally by The University of Illinois.

 

Supervised Learning(video)

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.

 

Unsupervised Learning(video)

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).

 

Who are Mentors?

 

Mentor Program Overview:

 

Community Mentors are successful, dedicated Coursera learners who volunteer to assist with support and discussion forum moderation in courses that they have already completed. They have been recruited by Coursera to encourage newer learners, answer questions, set an example by posting thoughtful and timely content, and report platform bugs and inappropriate content to Coursera.

 

As you use the discussion areas, please be aware that the ideas expressed by participants in this course, including the Mentors, do not represent the views of Stanford University. The mentors are not employed by Stanford University and they have not been vetted by Stanford University as experts on course content or course facilitation.

 

Get to Know Your Classmates

 

Get to Know Your Classmates

 

Overview

 

Working well with your classmates is an important part of this online course. Thus, at the beginning of this course, we would like you to take time to break the ice and get to know each other. You may already know some of your classmates or have just met them. Establishing personal interaction with other students will make your online learning experience much more enjoyable and engaging. As such, we encourage you to participate in this activity, though it is optional.

 

Meet and Greet

 

Tell everyone your story! Optionally, you are asked to provide a brief introduction to your classmates. If you don‘t know what to include in your introduction, you may want to provide information that you‘d like to share with your classmates by answering some of the following questions.

 

Suggested Topics

 

  • Where are you from? If you wish to include this information in your post, you can also include it below the body of your post in the "tags" area. For example, include your state (if living within the United States) or country in the tags section.
  • Career and education? What is your educational background? What do you currently do? Are you currently pursuing a change in careers and/or more education?
  • Hopes? Why did you decide to take this course? What are your expectations of this course? What problem are you trying to solve? What do you hope to put into place in your life the day this course is over?
  • Other info? Share with us any other information that might help others in the class find you when searching the forums. What common interests might you share with your classmates? We have tens of thousands of students enrolled in this course – put something in your post that will help others who are like you to find you.

 

Go to the Meet and Greet forum and click the New Thread button to begin a new thread. Use your name and a brief summary as the subject of your post. For example, Robert Smith: Exploring Career Options. Read some your classmates‘ postings. Pick at least 2 classmates‘ postings that are most interesting to you and add your friendly comments.

 

Updating Your Profile

 

Optionally, please consider updating your profile, which can also be accessed by clicking the Profile link in the menu that appears when you click on your name at the top-right corner of this screen. When people find you in the forums, they can click on your name to view your complete profile and get to know you more.

 

Time

 

This activity will take approximately 1 hour to complete.

 

These guidelines for interacting with fellow classmates via the forums were originally compiled by The University of Illinois.

 

 

 

Frequently Asked Questions

 The following Machine Learning Mentors volunteered time to compile this list of Frequently Asked Questions: Colin Beckingham, Kevin Burnham, Maxim Haytovich, Tom Mosher, Richard Gayle, Simon Crase, Michael Reardon and Paul Mielke.

Be sure to thank them when you see them in the discussion forums!

General Questions

Q: Is the grader server down? A: First step is to check here.

Q: The audio in the videos is quite bad sometimes, muffled or low volume. Please fix it. A: You can mitigate the audio issues by turning down the bass and up the treble if you have those controls, or using a headset, which naturally emphasizes the higher frequencies. Also you may want to switch on the English closed captioning. It is unlikely to be fixed in the near term because most students do not have serious problems and therefore it is low on the priority list.

Q: What does it mean when I see “Math Processing Error?” A: The page is attempting to use MathJax to render math symbols. Sometimes the content delivery network can be sluggish or you have caught the web page Ajax javascript code in an incomplete state. Normally just refreshing the page to make it load fully fixes the problem

Q: How can I download lectures? A: On Demand videos cannot be downloaded.

Q: Is there a prerequisite for this course?A: Students are expected to have the following background:

  • Knowledge of basic computer science principles and skills, at a level sufficient to write a reasonably non-trivial computer program.
  • Familiarity with the basic probability theory.
  • Familiarity with the basic linear algebra.

Q: Why do we have to use Matlab or Octave? Why not Clojure, Julia, Python, R or [Insert favourite language here]?A: As Prof. Ng explained in the 1st video of the Octave tutorial, he has tried teaching Machine Learning in a variety of languages, and found that students come up to speed faster with Matlab/Octave. Therefore the course was designed using Octave/Matlab, and the automatic submission grader uses those program interfaces. Octave and Matlab are optimized for rapid vectorized calculations, which is very useful in Machine Learning. R is a nice tool, but:

1. It is a bit too high level. This course shows how to actually implement the algorithms of machine learning, while R already has them implemented. Since the focus of this course is to show you what happens in ML algorithms under the hood, you need to use Octave 2. This course offers some starter code in Octave/Matlab, which will really save you tons of time solving the tasks.

Q: Has anyone figured out the how to solve this problem? Here is my code [Insert code]. A: This is a violation of the Coursera Honor Code. Find the Honor Code here.

Q: I‘ve submitted correct answers for [insert problem]. However I would like to compare my implementation with other who did correctly. A: This is a violation of the Coursera Honor Code. Find the Honor Code here.

Q: This is my email: [insert email]. Can we get the answer for the quiz? A: This is a violation of the Coursera Honor Code. Find the Honor Code here.

Q: Do I receive a certificate once I complete this course? A: Course Certificate is available in this course. Click here to learn about how Course Certificate works and how to purchase.

Q: Why do all the answers in a multiple correct question say correct response when you submit the answer to an in-video question? A: Coursera‘s software is designed to suggest the correctness of each state of the check box. Therefore, an answer having a correct answer tag below it means that the state of that check box is correct.

Q: What is the correct technique of entering a numeric answer to a text box question ? A: Coursera‘s software for numeric answers only supports ‘.‘ as the decimal delimiter (not ‘,‘) and require that fractions be simplified to decimals. For answers with many decimal digits, please use a 2 digits after decimal point rounding method when entering solutions if not mentioned in the question.

Q: What is the correct technique of entering a 1 element matrix ? A: They should be entered as just the element without brackets.

Q: What does a A being a 3 element vector or a 3 dimensional vector mean? A: If not described a vector as mentioned in the questions is A=element1element2element3.

Q: I think I found an error in a video. What should I do? A: First, check the errata section under resources menu. If you are unsure if it is an error, create a new thread in the discussion forum describing the error.

Q: My quiz grade displayed is wrong or I have a verification issue or I cannot retake a quiz. What should I do? A: Contact Help Center. These queries can only be resolved by learner support and it is best if they are contacted directly.


 

Review


 Model and Cost Function


 

Parameter Learning


 

Review


 Linear Algebra Review


 

Review

以上是关于Week1的主要内容,如果未能解决你的问题,请参考以下文章