MCPcopy Create free account
hub / github.com/catboost/catboost / test_load_dumps

Function test_load_dumps

catboost/python-package/ut/medium/test.py:749–765  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

747
748
749def test_load_dumps():
750 pool_size = (100, 10)
751 prng = np.random.RandomState(seed=20181219)
752 data = prng.randint(10, size=pool_size)
753 labels = _generate_nontrivial_binary_target(pool_size[0], prng=prng)
754 pool1 = Pool(data, labels)
755 lines = []
756 for i in range(len(data)):
757 line = [str(labels[i])] + [str(x) for x in data[i]]
758 lines.append('\t'.join(line))
759 text = '\n'.join(lines)
760 tmp_file = test_output_path('test_data_dumps')
761 with open(tmp_file, 'w') as f:
762 f.write(text)
763 pool2 = Pool(tmp_file)
764 assert _check_data(pool1.get_features(), pool2.get_features())
765 assert _check_data(pool1.get_label(), [int(label) for label in pool2.get_label()])
766
767
768@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 13

PoolClass · 0.90
lenFunction · 0.85
test_output_pathFunction · 0.85
get_labelMethod · 0.80
_check_dataFunction · 0.70
rangeFunction · 0.50
strClass · 0.50
openFunction · 0.50
intFunction · 0.50
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected