Optional Lab: Logistic Regression, Logistic Loss - Origin of formula

Hi !

In the lab, at a certain point, it is said:

Where does this formula come from? In the video Andrew started from two different functions for y=0 and y=1 and not from global one. From which previously introduced formula above would it be derived?

Thanks !

Each of the formulas Andrew presented give the cost for either the true or false examples.

The total cost is simply the sum of these two calculations.