When measured against the training data (which is supposed to be “correct”), the loss function measures how incorrect or “wrong” the model is by comparing the target data and predicted output values. A loss function is a function which measures the error between a single prediction and the corresponding actual value. There are many ways to calculate the loss function, but a simple one is the L1 Loss (absolute difference between expected and predicted result). The goal is to reduce the loss in your models. See Cost Function.