[Breaking] Remove num roots. (#5059)

This commit is contained in:
Jiaming Yuan
2019-12-05 21:58:43 +08:00
committed by GitHub
parent f3d8536702
commit 64af1ecf86
23 changed files with 87 additions and 189 deletions

View File

@@ -231,7 +231,6 @@ class TestBasic(unittest.TestCase):
assert output == solution
class TestBasicPathLike(unittest.TestCase):
"""Unit tests using the os_fspath and pathlib.Path for file interaction."""

View File

@@ -63,11 +63,11 @@ class TestDMatrix(unittest.TestCase):
# Sliced UInt array
z = np.array([12, 34, 56], np.uint32)[::2]
dmat = xgb.DMatrix(np.array([[]]))
dmat.set_uint_info('root_index', z)
from_view = dmat.get_uint_info('root_index')
dmat.set_uint_info('group', z)
from_view = dmat.get_uint_info('group_ptr')
dmat = xgb.DMatrix(np.array([[]]))
dmat.set_uint_info('root_index', z + 0)
from_array = dmat.get_uint_info('root_index')
dmat.set_uint_info('group', z + 0)
from_array = dmat.get_uint_info('group_ptr')
assert (from_view.shape == from_array.shape)
assert (from_view == from_array).all()
@@ -142,7 +142,7 @@ class TestDMatrix(unittest.TestCase):
dtrain.get_float_info('label')
dtrain.get_float_info('weight')
dtrain.get_float_info('base_margin')
dtrain.get_uint_info('root_index')
dtrain.get_uint_info('group_ptr')
def test_sparse_dmatrix_csr(self):
nrow = 100

View File

@@ -161,8 +161,6 @@ class TestRanking(unittest.TestCase):
"""
Retrieve the group number from the dmatrix
"""
# control that should work
self.dtrain.get_uint_info('root_index')
# test the new getter
self.dtrain.get_uint_info('group_ptr')