How does cost function differ from single number evaluation metric? Can we train to maximize F1 score?

In the video on the Single Number Evaluation Metric, Professor Ng gives an example where two classifiers A and B are evaluated according to their precision and recall. I thought the cost function was essentially trying to maximize precision, (minimizing negative precision) but now I am not sure.

What exactly is the cost function minimizing?

And, since we have a single metric called the F1 score, could we not set up the cost function to maximize the F1 score?

The cost function is used to minimize the loss or maximize the accuracy. The F1, precision and recall are used when there are class imbalances present, otherwise the accuracy metric should be ok.

You could automate the F1, precision and recall calculation after all these are based on math formulas but they are not used on all cases as mentioned above.

1 Like