Logistic Regression is a variant of linear regression where the target variable is categorical, i.e. it takes one out of a few possible discrete values. Each of these values is called a label....

in the second example, when Ytrue = 0, the cost function is show as :

L=−(0×log(0.8)+1×log(0.2))=−log(0.8)=1.60

but isn't it supposed to be −log(0.2) instead of −log(0.8) ?