[2014 Stanford Machine Learning tutorial notes] Chapter IV - assuming the form of multi-feature amount under multiple linear regression case

    In this section, we will begin to discuss a new version of linear regression. This is a more effective form that is suitable for the case of a plurality of variable or multiple variables.

    In our previous study, we have only a single feature variable x (such as housing area in the example below), we hope to use this to predict the amount of features (such as housing prices following the example of) y. We will assume for the H [theta] (X) = [theta] 0 + [theta] . 1 X.

    However, we are in many cases we have not only a feature of this housing area to predict housing prices, we will have more features of the age of the number of bedrooms, number of floors and houses to predict house prices.

    We use the variables X . 1 , X 2 , X . 3 , X . 4 is represented here four characteristics, represented by y predicted output variables.

  • We use n to represent the number of feature amounts , such as where n = 4.
  • We use m to represent the number of samples .
  • We use X ( i) represents the i-th input feature amount of training samples . For example, in this case X ( 2) a feature vector representing the second training sample, so X (2) represents a vector is [1416,3,2,40] (column vector). In this representation, the equivalent of a 2 index a set of training.
  • We use X j ( i) to represent the value of the i-th sample of the j-th training feature quantity . In this example X . 3 ( 2) represents a third characteristic value of the second feature vectors inside the training samples, it is 2.

    Now that we have a plurality of feature quantity, then we assume that the form should be written like?

  • Suppose our previous form is: H [theta] (X) = [theta] 0 + [theta] . 1 X.
  • Now we assume the form: H [theta] (X) = [theta] 0 + [theta] . 1 X . 1 + [theta] 2 X 2 + [theta] . 3 X . 3 + [theta] . 4 X . 4 . If we have n feature amounts, it is assumed that it is the form: H [theta] (X) = [theta] 0 + [theta] . 1 X . 1 + [theta] 2 X 2 + [theta] . 3 X . 3 + ...... + [theta] n X n .

    Next, we want to simplify the expression written above. We were to set the X- 0 = 1 (which means that for the i-th sample has the X- 0 (i) = 1). Of course, you can also think we have defined an additional amount of 0 feature. Previously we have n feature amounts (X 1 , X 2 , X ...... n ), since we additionally define a first feature quantity 0, and the constant value is 1, there are n + 1 th feature quantity. So now we feature vector = X-[X 0 , X . 1 , X 2 , ...... X n- ] (column vector), which is an n + 1 dimensional vector. We also put all the parameters can be written as a vector, [theta] = [[theta] 0 , [theta] . 1 , [theta] 2 , [theta] ...... n- ] (column vector), which is an n + 1 dimensional vector.

  •     In this case we assume the form can be written as: H [theta] (X) = [theta] 0 X 0 + [theta] . 1 X . 1 + [theta] 2 X 2 + [theta] . 3 X . 3 + ...... + [theta] n- X n- .

     More subtly, we can write this equation θ T the X-(transposed θ multiplied by the X-) .

 

Guess you like

Origin www.cnblogs.com/shirleyya/p/12605168.html