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:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user