As discussed in the previous chapter, there are two types of dependent variables—continuous and categorical variables. In the case of continuous variable prediction, the loss (error) function can be calculated by using the sum of squared error values across all predictions.
In cases where the dependent variable is a categorical variable with only two distinct values associated with it, loss is calculated as the binary cross-entropy error using this formula:
y*logp + (1-y)*log(1-p)
In cases where the dependent variable is a categorical variable with multiple distinct values, the loss is calculated using the categorical cross-entropy error as:
∑ y*logp
Where p is the probability of the event being a ...