Skip to content

Commit

Permalink
Initialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Sep 30, 2020
1 parent 2d2e72d commit bebf445
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/tree/tree_model.cc
Expand Up @@ -802,7 +802,7 @@ void RegTree::LoadCategoricalSplit(Json const& in) {
? 0
: common::KCatBitField::ComputeStorageSize(max_cat);
size = size == 0 ? 1 : size;
std::vector<uint32_t> cat_bits_storage(size);
std::vector<uint32_t> cat_bits_storage(size, 0);
common::CatBitField cat_bits{common::Span<uint32_t>(cat_bits_storage)};
for (auto j = j_begin; j < j_end; ++j) {
cat_bits.Set(common::AsCat(get<Integer const>(categories[j])));
Expand Down
4 changes: 2 additions & 2 deletions tests/python-gpu/test_gpu_updaters.py
Expand Up @@ -61,12 +61,12 @@ def run_categorical_basic(self, cat, onehot, label, rounds):
np.testing.assert_allclose(
np.array(by_etl_results['Train']['rmse']),
np.array(by_builtin_results['Train']['rmse']),
rtol=1e-4)
rtol=1e-3)
assert tm.non_increasing(by_builtin_results['Train']['rmse'])

@given(strategies.integers(10, 400), strategies.integers(5, 10),
strategies.integers(1, 6), strategies.integers(4, 8))
@settings(deadline=None, verbosity=2)
@settings(deadline=None)
@pytest.mark.skipif(**tm.no_pandas())
def test_categorical(self, rows, cols, rounds, cats):
import pandas as pd
Expand Down

0 comments on commit bebf445

Please sign in to comment.