remove warning from MSVC need another round of check

This commit is contained in:
Tianqi Chen
2014-11-23 20:52:13 -08:00
parent b55fe80350
commit 2e444f8338
12 changed files with 32 additions and 28 deletions

View File

@@ -324,7 +324,7 @@ class GBTree : public IGradBooster {
unsigned ntree_limit) {
// number of valid trees
if (ntree_limit == 0 || ntree_limit > trees.size()) {
ntree_limit = trees.size();
ntree_limit = static_cast<unsigned>(trees.size());
}
std::vector<float> &preds = *out_preds;
preds.resize(info.num_row * ntree_limit);