Return Python float instead of numpy.float64 in sklearn metrics
MEMBER
I opened an issue on the `sklearn` repo to understand why `numpy.float64` is the default: https://github.com/scikit-learn/scikit-learn/discussions/20490
2021-07-09T10:02:09Z
https://github.com/huggingface/datasets/pull/2612#issuecomment-877069300
https://api.github.com/repos/huggingface/datasets/issues/2612
MDEyOklzc3VlQ29tbWVudDg3NzA2OTMwMA==
https://api.github.com/repos/huggingface/datasets/issues/comments/877069300/reactions
2021-07-09T10:02:09Z
https://api.github.com/repos/huggingface/datasets/issues/comments/877069300
https://avatars.githubusercontent.com/u/26859204?v=4
https://api.github.com/users/lewtun/events{/privacy}
https://api.github.com/users/lewtun/followers
https://api.github.com/users/lewtun/following{/other_user}
https://api.github.com/users/lewtun/gists{/gist_id}
https://github.com/lewtun
lewtun
MDQ6VXNlcjI2ODU5MjA0
https://api.github.com/users/lewtun/orgs
https://api.github.com/users/lewtun/received_events
https://api.github.com/users/lewtun/repos
https://api.github.com/users/lewtun/starred{/owner}{/repo}
https://api.github.com/users/lewtun/subscriptions
User
https://api.github.com/users/lewtun
public
MEMBER
It could be surprising at first to use `tolist()` on numpy scalars but it works ^^
2021-07-09T12:58:38Z
https://github.com/huggingface/datasets/pull/2612#issuecomment-877167873
https://api.github.com/repos/huggingface/datasets/issues/2612
MDEyOklzc3VlQ29tbWVudDg3NzE2Nzg3Mw==
https://api.github.com/repos/huggingface/datasets/issues/comments/877167873/reactions
2021-07-09T12:58:38Z
https://api.github.com/repos/huggingface/datasets/issues/comments/877167873
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
MEMBER
did the same for Pearsonr here: https://github.com/huggingface/datasets/pull/2614
2021-07-09T13:23:11Z
https://github.com/huggingface/datasets/pull/2612#issuecomment-877184473
https://api.github.com/repos/huggingface/datasets/issues/2612
MDEyOklzc3VlQ29tbWVudDg3NzE4NDQ3Mw==
https://api.github.com/repos/huggingface/datasets/issues/comments/877184473/reactions
2021-07-09T13:23:11Z
https://api.github.com/repos/huggingface/datasets/issues/comments/877184473
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
This PR converts the return type of all `sklearn` metrics to be Python `float` instead of `numpy.float64`.

The reason behind this is that our Hub evaluation framework relies on converting benchmark-specific metrics to YAML ([example](https://huggingface.co/datasets/autonlp/autonlp-benchmark-raft-neelalex__raft-test-neelalex__raft-predictions-3/blob/main/README.md#L11)) and the `numpy.float64` format produces garbage like:

```python
import yaml
from datasets import load_metric

metric = load_metric("accuracy")
score = metric.compute(predictions=[0,1], references=[0,1])
print(yaml.dump(score["accuracy"])) # output below
# !!python/object/apply:numpy.core.multiarray.scalar
# - !!python/object/apply:numpy.dtype
#   args:
#   - f8
#   - false
#   - true
#   state: !!python/tuple
#   - 3
#   - <
#   - null
#   - null
#   - null
#   - -1
#   - -1
#   - 0
# - !!binary |
#   AAAAAAAA8D8=
```