Replace item with float in metrics
As pointed out by @mariosasko in #3001, calling `float()` instad of `.item()` is faster.

Moreover, it might avoid potential issues if any of the third-party functions eventually returns a `float` instead of an `np.float64`.

Related to #3001.