https://www.coursera.org/learn/machine-learning/lecture/0hpr8/cost-function-for-logistic-regression.
In the above video, the loss function is mentioned as below -
𝑙𝑜𝑠𝑠(𝑓𝐰,𝑏(𝐱(𝑖)),𝑦(𝑖))=
−log(𝑓𝐰,𝑏(𝐱(𝑖))) if 𝑦(𝑖)=1
−log(1−𝑓𝐰,𝑏(𝐱(𝑖))) if 𝑦(𝑖)=0
It looks like we only use the predicted value[𝑓𝐰,𝑏(𝐱(𝑖))] to calculate the cost when we are using the above cross-entropy.
Now the question will the loss function return the same loss as long as the 𝑓𝐰,𝑏(𝐱(𝑖)) is same irrespective of what we are predicting.
For an example say we have 2 separate problems -
- We are predicting whether the tumor is malignant and y is 1(malignant) and 𝑓𝐰,𝑏(𝐱(𝑖)) is 0.3 for a data point.
- We are predicting whether or not spam and y is 1(spam) and 𝑓𝐰,𝑏(𝐱(𝑖)) is 0.3 for a data point.
Do we get the same loss when we use the above-mentioned cross-entropy loss function for both the predictions in the above example?