Here's the situation:

  • Users have manually drawn a straight line of best fit through a set of data points. I have the equation (y = mx + c) for this line.

  • I have used least-squares regression to determine the optimal line of best fit for the same data.

How can I assess the quality of the user-drawn LOBF? My first thought was just to work out the uncertainty between the two gradients and the two y-intercepts, but that produces dramatic errors when the true value of either the gradient or the y-intercept is close to zero. Any suggestions, please?


1 Answer 1


Square error is calculated the same way, no matter how you fit a model (OLS, random forest, deep learning, or guessing like you are doing).

$$ \sum_{i=1}^n\bigg( Y_{true, i}-Y_{predicted, i} \bigg)^2 $$

Divide by the sample size if you want an average.

If you want to automate this task for a computer to do it, calculate the slope and intercept of your guesses line of best fit. Pick two points on your line, $(x_0,y_0)$ and $(x_1,y_1)$.

$$ y-y_0 = \dfrac{ y_1-y_0 }{ x_1-x_0 } \bigg( x-x_0 \bigg) $$

When you do the algebra to solve for $y$ in terms of $x$, you will have the equation for the line you’ve fitted by eyeballing it. You then can use this to make predictions to feed into the square error formula.


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.