Loading [MathJax]/jax/output/HTML-CSS/jax.js

2/27/17

Gradient descent for multiple variables

Continue from the preceding example

[Ex]
Size in feet2(x1)# bedrooms(x2)# floors(x3)Age(x4)Price $1000 (y)2104514546014163240232153432303158522136178...............

Notation:

  • n = number of variables
  • m = number of examples
  • x(i) = input variables of  ith training example.
  • x(i)j = value of input variable j  in ith training example.
Hypothesis: hθ(x)=θ0+θ1x1+θ2x2+θ3x3+θ4x4

For convenience of notation, define x0=1, it means x(i)0=1, so the hypothesis can transfer as:


hθ(x)=θ0x0+θ1x1+θ2x2+θ3x3+θ4x4
         =θTx

So, the definition is as below:

[Def]
repeat until convergence:{θj:=θjα1mmi=1(hθ(x(i))y(i))x(i)jfor j := 0...n}

No comments:

Post a Comment