Cost function (machine learning)
A cost function is a mechanism utilized in supervised machine learning, the cost function returns the error between predicted outcomes compared with the actual outcomes. The aim of supervised machine learning is to minimize the overall cost, thus optimizing the correlation of the model to the system that it is attempting to represent.
NB loss function is defined as the error for one sample, whereas the cost function is the average loss across a number of samples in a given dataset.