The meaning of this invariance test is to check that it work correctly whatever the type of y1 (number, string or string with dtype=object). Can you correct the test and add an appropriate general test for the hinge loss and log loss?