Multiple Features
Note:
![](https://img.haomeiwen.com/i14494447/023d392ebb5085bf.png)
Linear regression with multiple variables is also known as "multivariate linear regression".
We now introduce notation for equations where we can have any number of input variables.
![](https://img.haomeiwen.com/i14494447/92edfc2b32f55d01.png)
The multivariable form of the hypothesis function accommodating these multiple features is as follows:
![](https://img.haomeiwen.com/i14494447/639ba5e76c707e09.png)
In order to develop intuition about this function, we can think about θ0 as the basic price of a house, θ1 as the price per square meter, θ2 as the price per floor, etc. x_1 will be the number of square meters in the house, x_2 the number of floors, etc.
Using the definition of matrix multiplication, our multivariable hypothesis function can be concisely represented as:
![](https://img.haomeiwen.com/i14494447/5c860a0272d1037a.png)
This is a vectorization of our hypothesis function for one training example; see the lessons on vectorization to learn more.
Remark: Note that for convenience reasons in this course we assume
![](https://img.haomeiwen.com/i14494447/d473c1e825ece438.png)
This allows us to do matrix operations with theta and x. Hence making the two vectors 'θ' and x_i match each other element-wise (that is, have the same number of elements: n+1)]
来源:coursera 斯坦福 吴恩达 机器学习
网友评论