Fix model slicing. (#7149)

* Use correct pointer.
* Remove best_iteration/best_score.
This commit is contained in:
Jiaming Yuan
2021-08-03 11:51:56 +08:00
committed by GitHub
parent 36346f8f56
commit d080b5a953
6 changed files with 37 additions and 5 deletions

View File

@@ -397,6 +397,10 @@ std::pair<Json, Json> TestModelSlice(std::string booster) {
j++;
}
// CHECK sliced model doesn't have dependency on old one
learner.reset();
CHECK_EQ(sliced->GetNumFeature(), kCols);
return std::make_pair(model, sliced_model);
}