File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
autointent/modules/scoring Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ class LinearScorer(ScoringModule):
2525 --------
2626 .. testcode::
2727
28+ import numpy as np
2829 from autointent.modules import LinearScorer
2930 scorer = LinearScorer(
3031 embedder_name="sergeyzh/rubert-tiny-turbo", cv=2
@@ -34,12 +35,13 @@ class LinearScorer(ScoringModule):
3435 scorer.fit(utterances, labels)
3536 test_utterances = ["hi", "bye"]
3637 probabilities = scorer.predict(test_utterances)
37- print(probabilities)
38+ with np.printoptions(precision=4):
39+ print(probabilities)
3840
3941 .. testoutput::
4042
41- [[0.50000032 0.49999968 ]
42- [0.50000032 0.49999968 ]]
43+ [[0.5 0.5] ]
44+ [0.5 0.5 ]]
4345
4446 """
4547
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ class MLKnnScorer(ScoringModule):
2424
2525 .. testcode::
2626
27+ import numpy as np
2728 from autointent.modules.scoring import MLKnnScorer
2829 utterances = ["what is your name?", "how are you?"]
2930 labels = [[1,0], [0,1]]
@@ -34,7 +35,8 @@ class MLKnnScorer(ScoringModule):
3435 scorer.fit(utterances, labels)
3536 test_utterances = ["Hi!", "What's up?"]
3637 probabilities = scorer.predict(test_utterances)
37- print(probabilities) # Outputs predicted probabilities for each label
38+ with np.printoptions(precision=4):
39+ print(probabilities) # Outputs predicted probabilities for each label
3840
3941 .. testoutput::
4042
You can’t perform that action at this time.
0 commit comments