mirror of
https://github.com/GokuMohandas/Made-With-ML.git
synced 2026-03-09 07:12:37 -05:00
12 lines
312 B
Python
12 lines
312 B
Python
from madewithml import predict
|
|
|
|
|
|
def test_decode():
|
|
decoded = predict.decode(indices=[0, 1, 1], index_to_class={0: "x", 1: "y"})
|
|
assert decoded == ["x", "y", "y"]
|
|
|
|
|
|
def test_format_prob():
|
|
d = predict.format_prob(prob=[0.1, 0.9], index_to_class={0: "x", 1: "y"})
|
|
assert d == {"x": 0.1, "y": 0.9}
|