0
$\begingroup$

The instructor of the machine learning course I've been taking whipped this algorithm at my head without explaining how to apply it to a training set.

enter image description here

m = number of training sets (3)
j = subscript 0 or 1
x(i) = x from the ith training set
y(i) = y from the ith training set
alpha = ?
h theta = ?

If I had a training set of (1,1), (2,2), (3,3), how would I go about entering it into this algorithm?

$\endgroup$

1 Answer 1

2
$\begingroup$

you do this with one training set at a time.so, x(i) = the "features" for the ith subject h_theta(x(i)) = the predicted response for the ith subject given the features x(i) y(i) = the actual response for the ith subject thats a cost function. alpha is the learning rate, you choose it. h_theta is the hypothesis function that describes your data (for example, h_theta(x) = theta_0 + theta_1*x).

basically you start with an initial guess of the theta's (theta_0 = 1, theta_1= 1), evaluate the expression "temp 1" above, and keep updating theta_{n+1} until theta_{n+1} - theta_{n} has a very small negligible difference (say, 10^-6).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.