Advertisement
aschuma

ML::02

Sep 19th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. Model Representation
  2. ---------------------
  3.  
  4. To establish notation for future use, we’ll use
  5. x^(i) to denote the “input” variables (living area in the example), also called input features, and
  6. y^(i) to denote the “output” or target variable that we are trying to predict (price).
  7.  
  8. Training example: A pair (x^(i) , y^(i)) (Note that the superscript “(i)” in the notation is simply an index into the training set, and has nothing to do with exponentiation)
  9.  
  10. Training set: (x(i),y(i));i=1,...,m . (The dataset that we’ll be using to learn)
  11.  
  12. X: the space of input values
  13. Y: the space of output values. In this example, X = Y = ℝ.
  14.  
  15. Goal: given a training set, learn a function h : X → Y so that h(x) is a “good” predictor for the corresponding value of y.
  16.  
  17. Training Set --> Learning Algorithm --> (h:X->Y)
  18.  
  19. "hypothesis": the function h (named so due to historical reasons)
  20.  
  21. When the target variable is continuous: "regression problem"
  22. When y can take on only a small number of discrete values: "classification problem"
  23.  
  24.  
  25.  
  26.  
  27. Cost Function
  28. --------------
  29.  
  30. Measure the accuracy of our hypothesis function by using a cost function.
  31.  
  32. This takes an average difference (actually a fancier version of an average) of all the results of the hypothesis with inputs from x's and the actual output y's.
  33.  
  34. i=1,..,m
  35. J(theta_0, theta_1) = (1 / 2m) * ∑ ( h(x^(i)) - y^(i) )^2
  36.  
  37. h:x->y = theta_0 + theta_1 * x
  38.  
  39. J: "Squared error function", or "Mean squared error"
  40.  
  41.  
  42. Objective: Choose theta_0, theta_1 so that J(theta_0, theta_1) is minimal for training data set (x,y)
  43.  
  44.  
  45. Terms
  46. -----
  47. Contour plot of cost function: A contour plot is a graph that contains many contour lines. A contour line of a two variable function has a constant value at all points of the same line, c (like isobars)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement