Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

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?

share|improve this question

1 Answer

up vote 1 down vote accepted

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).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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