You can use `zero_one_loss` that does exactly what you want.