Prediction by indices (subsample < 1) (#6683)

* Another implementation of predicting by indices

* Fixed omp parallel_for variable type

* Removed SparsePageView from Updater
This commit is contained in:
Igor Rukhovich
2021-03-16 05:08:20 +03:00
committed by GitHub
parent 366f3cb9d8
commit 19a2c54265
4 changed files with 139 additions and 59 deletions

View File

@@ -183,7 +183,7 @@ TEST(CpuPredictor, InplacePredict) {
}
}
TEST(CpuPredictor, UpdatePredictionCache) {
void TestUpdatePredictionCache(bool use_subsampling) {
size_t constexpr kRows = 64, kCols = 16, kClasses = 4;
LearnerModelParam mparam;
mparam.num_feature = kCols;
@@ -198,6 +198,9 @@ TEST(CpuPredictor, UpdatePredictionCache) {
std::map<std::string, std::string> cfg;
cfg["tree_method"] = "hist";
cfg["predictor"] = "cpu_predictor";
if (use_subsampling) {
cfg["subsample"] = "0.5";
}
Args args = {cfg.cbegin(), cfg.cend()};
gbm->Configure(args);
@@ -226,6 +229,11 @@ TEST(CpuPredictor, UpdatePredictionCache) {
}
}
TEST(CpuPredictor, UpdatePredictionCache) {
TestUpdatePredictionCache(false);
TestUpdatePredictionCache(true);
}
TEST(CpuPredictor, LesserFeatures) {
TestPredictionWithLesserFeatures("cpu_predictor");
}