I have recently started Andrew NG's Machine Learning course on Coursera and I came across this cost function which is:
Why does the error in the cost function need to be squared? If its purpose is to eliminate the negative sign in the error then why don't we simply use the absolute function?