Support categorical data for dask functional interface and DQM. (#7043)
* Support categorical data for dask functional interface and DQM. * Implement categorical data support for GPU GK-merge. * Add support for dask functional interface. * Add support for DQM. * Get newer cupy.
This commit is contained in:
@@ -68,7 +68,16 @@ void TestEquivalent(float sparsity) {
|
||||
auto const& buffer_from_iter = page_concatenated->gidx_buffer;
|
||||
auto const& buffer_from_data = ellpack.Impl()->gidx_buffer;
|
||||
ASSERT_NE(buffer_from_data.Size(), 0);
|
||||
ASSERT_EQ(buffer_from_data.ConstHostVector(), buffer_from_data.ConstHostVector());
|
||||
|
||||
common::CompressedIterator<uint32_t> data_buf{
|
||||
buffer_from_data.ConstHostPointer(), from_data.NumSymbols()};
|
||||
common::CompressedIterator<uint32_t> data_iter{
|
||||
buffer_from_iter.ConstHostPointer(), from_iter.NumSymbols()};
|
||||
CHECK_EQ(from_data.NumSymbols(), from_iter.NumSymbols());
|
||||
CHECK_EQ(from_data.n_rows * from_data.row_stride, from_data.n_rows * from_iter.row_stride);
|
||||
for (size_t i = 0; i < from_data.n_rows * from_data.row_stride; ++i) {
|
||||
CHECK_EQ(data_buf[i], data_iter[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -225,6 +225,9 @@ void TestCategoricalPrediction(std::string name) {
|
||||
row[split_ind] = split_cat;
|
||||
auto m = GetDMatrixFromData(row, 1, kCols);
|
||||
|
||||
std::vector<FeatureType> types(10, FeatureType::kCategorical);
|
||||
m->Info().feature_types.HostVector() = types;
|
||||
|
||||
predictor->InitOutPredictions(m->Info(), &out_predictions.predictions, model);
|
||||
predictor->PredictBatch(m.get(), &out_predictions, model, 0);
|
||||
ASSERT_EQ(out_predictions.predictions.Size(), 1ul);
|
||||
|
||||
Reference in New Issue
Block a user