[x] Handle loss functions both with and without sample_weight parameter to maintain backwards compatibility with existing loss functions
Notes:
One approach would have been to extend all existing loss functions to be compatible with weights, but we thought the calculate_loss() to handle both cases to be more appropriate since this way we can handle any user-defined custom loss function that does not take weights
The explicit check for the parameter named sample_weight is in line with the scikit-learn signature - any custom loss functions wanting to use weights need to have the parameter named this way too
Issue #563
In this PR:
loss_after_permutation()
sample_weight
parameter to maintain backwards compatibility with existing loss functionsNotes:
calculate_loss()
to handle both cases to be more appropriate since this way we can handle any user-defined custom loss function that does not take weightssample_weight
is in line with thescikit-learn
signature - any custom loss functions wanting to use weights need to have the parameter named this way too