Automatically remove nan from input data when it is sparse. (#2062)

* [DATALoad] Automatically remove Nan when load from sparse matrix

* add log
This commit is contained in:
Tianqi Chen
2017-02-25 08:59:17 -08:00
committed by GitHub
parent 5d093a7f4c
commit fd19b7a188
4 changed files with 41 additions and 20 deletions

View File

@@ -670,9 +670,8 @@ class ColMaker: public TreeUpdater {
#pragma omp parallel for schedule(static)
for (bst_omp_uint i = 0; i < ndata; ++i) {
const bst_uint ridx = rowset[i];
if (ridx >= position.size()) {
LOG(INFO) << "ridx exceed bound\n";
}
CHECK_LT(ridx, position.size())
<< "ridx exceed bound " << "ridx="<< ridx << " pos=" << position.size();
const int nid = this->DecodePosition(ridx);
if (tree[nid].is_leaf()) {
// mark finish when it is not a fresh leaf

View File

@@ -298,8 +298,15 @@ class CQHistMaker: public HistMaker<TStats> {
hist.data[istart].Add(gstats);
} else {
while (istart < hist.size && !(fv < hist.cut[istart])) ++istart;
CHECK_NE(istart, hist.size);
hist.data[istart].Add(gstats);
if (istart != hist.size) {
hist.data[istart].Add(gstats);
} else {
LOG(INFO) << "fv=" << fv << ", hist.size=" << hist.size;
for (size_t i = 0; i < hist.size; ++i) {
LOG(INFO) << "hist[" << i << "]=" << hist.cut[i];
}
LOG(FATAL) << "fv=" << fv << ", hist.last=" << hist.cut[hist.size - 1];
}
}
}
};