Coursera Machine Learning Study notes (12)

Source: Internet
Author: User

-Normal equation

So far, the gradient descent algorithm has been used in linear regression problems, but for some linear regression problems, the normal equation method is a better solution.

The normal equation is solved by solving the following equations to find the parameters that make the cost function least:

Assuming our training set feature matrix is x, our training set results are vector y, then the normal equation is used to solve the vector:

The following table shows the data as an example:

The normal equation method is used to solve the parameters:

Note: The normal equation method is not available for those non-reversible matrices (usually because the features are not independent of each other, such as dimensions that include both feet and meters in size two features, or because the number of features is greater than the number of training sets).

The comparison of gradient descent with the normal equation is as follows:



Coursera Machine Learning Study notes (12)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.