Skip to content

Commit 152c3ed

Browse files
committed
[ML][Python] Fix udnersampling test - rounding below min sampling ratio
1 parent d46a25a commit 152c3ed

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

bindings/pyroot/pythonizations/test/ml_dataloader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import math
12
import os
23
import unittest
34
from random import randrange, uniform
@@ -5779,7 +5780,7 @@ def test14_big_data_replacement_false(self):
57795780
entries_in_rdf_minor = randrange(8000, 9999)
57805781
batch_size = randrange(100, 501)
57815782
min_allowed_sampling_ratio = entries_in_rdf_minor / entries_in_rdf_major
5782-
sampling_ratio = round(uniform(min_allowed_sampling_ratio, 2), 2)
5783+
sampling_ratio = math.ceil(uniform(min_allowed_sampling_ratio, 2) * 100) / 100
57835784

57845785
error_message = f"\n Batch size: {batch_size}\
57855786
Number of major entries: {entries_in_rdf_major} \

0 commit comments

Comments
 (0)