Explain 'Cost Function'.

Explain 'Cost Function'.

Approach: Define the measure of how wrong the model is over the entire dataset.

A function that measures the performance of a machine learning model for given data. It quantifies the error between predicted and actual values and is the function that optimization algorithms seek to minimize.

Follow-up: How does it differ from a loss function?

Key concepts: optimization, error, objective function.