Comparison

Loss Function vs. Cost Function

In machine learning, a distinction is made between a loss function and a cost function. A loss function (or error function) calculates the penalty for a single training example. For a given sample consisting of input features xx and a true label yy, the loss function L(y^,y)L(\hat{y}, y) measures the discrepancy between the model's prediction y^\hat{y} and the true label yy. In contrast, a cost function (or objective function) is typically the average of the loss function values over the entire training set, providing an aggregate measure of the model's performance.

0

0

Updated 2025-10-10

Tags

Data Science

Ch.2 Generative Models - Foundations of Large Language Models

Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences