Kamil Krzyk Updated on May 22, 2025
A cost function in machine learning quantifies the error between a model’s predicted values and actual values, letting us measure how well a model's parameters fit given data. I’ll introduce you to two often-used regression cost functions: MAE and MSE.