This article will cover:
(1) Another Linear Regression Method: normal equation; (2) Advantages and Disadvantages of gradient descent and normal equation;
Previously we used the Gradient Descent Method for linear regression, but gradient descent has the following features:
(1) learning rate needs to be selected in advance; (2) Multiple iteration is required; (3) feature scaling is required; therefore, it may be troublesome, this article introduces a method suitable for the use of a small number of feature: normal equation; use normal equation when the number of feature is smaller than 100000; Use gradient descent when the number of feature is greater than 100000; normal equation has the following features: simple, convenient, and does not require feature scaling. The formula of normal equation indicates the I training example; indicates the value of the J feature in the I training example; m is # training example; n is # feature;