Download archive-misc/f1_score.py from jblitzar/code-completion: direct link, hf CLI and curl.
- Browser
- Download file 498 Bytes
-
https://huggingface.co/jblitzar/code-completion/resolve/main/archive-misc/f1_score.py
- Command line
-
hf download hf://jblitzar/code-completion/archive-misc/f1_score.py
-
curl -L -o f1_score.py https://huggingface.co/jblitzar/code-completion/resolve/main/archive-misc/f1_score.py
498 Bytes
| from sklearn.metrics import f1_score | |
| print("imported!") | |
| exit() | |
| from copy import deepcopy | |
| import numpy as np | |
| # y_true = [0] * 50 + [0] * 5 + [0] * 10 + [1] * 8 + [1] * 40 + [1] * 12+ [2] * 5 + [2] * 7 + [2] * 50 | |
| # y_pred = [0] * 50 + [1] * 5+ [2] * 10 + [0] * 8 + [1] * 40+ [2] * 12+ [0] * 5 + [1] * 7 + [2] * 50 | |
| # y_true = deepcopy(y_true) | |
| # y_pred = deepcopy(y_pred) | |
| # print(y_true) | |
| # y_true = np.array(y_true) | |
| # y_pred = np.array(y_pred) | |
| # print(f1_score(y_true, y_pred, average='sample')) | |