Spaces:
Runtime error
Runtime error
File size: 704 Bytes
4564a8c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
import evaluate
import numpy as np
accuracyk = evaluate.load("./accuracyk.py", use_auth_token=True)
predictions = np.array([
[0, 7, 1, 3, 5],
[0, 2, 9, 8, 4],
[8, 4, 0, 1, 3],
])
references = np.array([
3,
4,
0
])
results = accuracyk.compute(predictions=predictions, references=references)
print(results)
predictions = [
[0, 7, 1, 3, 5],
[0, 2, 9, 8, 4],
[8, 4, 0, 1, 3],
]
references = [3, 5, 0]
results = accuracyk.compute(predictions=predictions, references=references)
predictions = np.array([ 3, 8, 1 ])
references = np.array([ 3, 4, 0 ])
results = accuracyk.compute(predictions=np.expand_dims(predictions, axis=1), references=references)
print(results)
|