What is Cost Function?

Cost Function

It is a function that measures the performance of a Machine Learning model for given data.

It quantifies the error between predicted values and expected values and presents it in the form of a single real number. Depending on the problem Cost Function can be formed in many different ways. The purpose of Cost Function is to be either:

  • Minimized – then returned value is usually called costloss or error. The goal is to find the values of model parameters for which Cost Function return as small number as possible.

  • Maximized – then the value it yields is named a reward. The goal is to find values of model parameters for which returned number is as large as possible.