Used to measure performance/accuracy of machine-learning models.
For classification, models like a decision-tree and a perceptron, measure of performance is the classification error expressed as a percentage i.e., the number of outputs that are mislabelled
we can also use a confusion-matrix to measure the distribution of errors
accuracy
is the inverse of classification error i.e.,
mean squared error (MSE)
measures the distance of models output from target value i.e., how wrong is the model . The squared disatance of predictions form the target values. Sometimes root MSE is more useful.
One limitation is the MSE is quite affected by large outliers
least squares
refers to the analytical solution for that gives smallest Given and , find the values of that give the smallest :
, where is the dot product.
The use of matrices makes it very easy to compute fast using a GPU.
In Python: w=np.dot(np.dot(np.linalg.inv(np.dot(X.T,X)),X.T),y))