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.

I have implemented linear regression manually, for learning purposes, and I use the "Auto MPG" data set as the toy data I'm applying it to.

It occured to me that I don't know how to test the efficiency of my model! With classification I can check the predicted class vs the actual class, but what do I do with regression?

EDIT: Of course, I am splitting the data I have into train + test data...I am speaking of evaluating the results when I apply the model on the test data.

For instance, using my model I predict 16.76 mpg for a car for which the actual value in the data set is 15.5. How do I decide whether this is a "good" or "bad" prediction? I am thinking of using some thresholds ("if the predicted value is within the [actual-epsilon, actual+epsilon] interval => OK!"), but is this a good approach? And even if it is, how do I choose epsilon values?

I am aware of the fact that there's most likely no clear-cut answer, but any suggestion regarding the approach to take would be most helpful.

EDIT: I've decided to go with the following approach: for each test data sample, I am computing how far the predicted value is from the test data as

abs(predicted_value - actual_value) * 100 /  actual_value

i.e. how far away is the prediction from the actual value, expressed in % of actual value. Any feedback is still welcome, since this is just an idea I've had, and I'm not sure if it is "best practice".

share|improve this question

1 Answer

up vote 3 down vote accepted

I suggest using RMSE (root mean square error) of your predictions on your test set when compared to the actual value. This is a standard method of reporting prediction error of a continuous variable. You can use R^2 to examine how well your model fits the training data.

share|improve this answer
Thanks a lot for the suggestion, this is exactly what I was looking for! So I would do sqrt(sum((predicted_i - actual_i)^2)/#samples), where i=1..#samples? – Cristina May 11 '12 at 13:37
Yes, thats correct. – BGreene May 11 '12 at 13:57

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.