module documentation
A small collection of loss functions
Helper function to get a loss function
Return the appropriate loss function depending on the given string
- Args
- func:
- Query string for the requested loss function
- Returns
- Appropriate function
Mean Squared Error
It is a loss/cost function to calculate error between the predicted data and the actual data.
MSE = (1 / 2)(Sum (i = 1 to n)(y_i - y^_i) ^ 2)
It is the mean of all errors squared. It is multiplied with 1/2 instead of 1/n to simplify the partial derivative.
- Args
- pred_val:
- The input vector to calculate the error for
- obs_val:
- The actual observed values
- Returns
- Overall error of the output