diff --git a/src/data.h b/src/data.h index 4316885b1..9cd352584 100644 --- a/src/data.h +++ b/src/data.h @@ -70,12 +70,12 @@ struct SparseBatch { /*! \brief an entry of sparse vector */ struct Entry { /*! \brief feature index */ - bst_uint findex; + bst_uint index; /*! \brief feature value */ bst_float fvalue; // default constructor Entry(void) {} - Entry(bst_uint findex, bst_float fvalue) : findex(findex), fvalue(fvalue) {} + Entry(bst_uint index, bst_float fvalue) : index(index), fvalue(fvalue) {} /*! \brief reversely compare feature values */ inline static bool CmpValue(const Entry &a, const Entry &b) { return a.fvalue < b.fvalue; @@ -190,7 +190,7 @@ class FMatrixS : public FMatrixInterface{ } } inline bst_uint rindex(void) const { - return dptr_->findex; + return dptr_->index; } inline bst_float fvalue(void) const { return dptr_->fvalue; @@ -345,7 +345,7 @@ class FMatrixS : public FMatrixInterface{ buffered_rowset_.push_back(static_cast(batch.base_rowid+i)); SparseBatch::Inst inst = batch[i]; for (bst_uint j = 0; j < inst.length; ++j) { - builder.AddBudget(inst[j].findex); + builder.AddBudget(inst[j].index); } } } @@ -362,7 +362,7 @@ class FMatrixS : public FMatrixInterface{ ++ktop; SparseBatch::Inst inst = batch[i]; for (bst_uint j = 0; j < inst.length; ++j) { - builder.PushElem(inst[j].findex, + builder.PushElem(inst[j].index, Entry((bst_uint)(batch.base_rowid+i), inst[j].fvalue)); } diff --git a/src/gbm/gblinear-inl.hpp b/src/gbm/gblinear-inl.hpp index 9a7e3d8b6..6fe0dcf83 100644 --- a/src/gbm/gblinear-inl.hpp +++ b/src/gbm/gblinear-inl.hpp @@ -150,7 +150,7 @@ class GBLinear : public IGradBooster { for (int gid = 0; gid < model.param.num_output_group; ++gid) { float psum = model.bias()[gid]; for (bst_uint i = 0; i < inst.length; ++i) { - psum += inst[i].fvalue * model[inst[i].findex][gid]; + psum += inst[i].fvalue * model[inst[i].index][gid]; } preds[gid] = psum; } diff --git a/src/io/simple_dmatrix-inl.hpp b/src/io/simple_dmatrix-inl.hpp index 99bd0b932..583d4ba2a 100644 --- a/src/io/simple_dmatrix-inl.hpp +++ b/src/io/simple_dmatrix-inl.hpp @@ -62,7 +62,7 @@ class DMatrixSimple : public DataMatrix { inline size_t AddRow(const std::vector &feats) { for (size_t i = 0; i < feats.size(); ++i) { row_data_.push_back(feats[i]); - info.info.num_col = std::max(info.info.num_col, static_cast(feats[i].findex+1)); + info.info.num_col = std::max(info.info.num_col, static_cast(feats[i].index+1)); } row_ptr_.push_back(row_ptr_.back() + feats.size()); info.info.num_row += 1; @@ -81,7 +81,7 @@ class DMatrixSimple : public DataMatrix { std::vector feats; while (fscanf(file, "%s", tmp) == 1) { SparseBatch::Entry e; - if (sscanf(tmp, "%u:%f", &e.findex, &e.fvalue) == 2) { + if (sscanf(tmp, "%u:%f", &e.index, &e.fvalue) == 2) { feats.push_back(e); } else { if (!init) { diff --git a/src/tree/model.h b/src/tree/model.h index 4266f465f..6d4935355 100644 --- a/src/tree/model.h +++ b/src/tree/model.h @@ -493,13 +493,13 @@ class RegTree: public TreeModel{ /*! \brief fill the vector with sparse vector */ inline void Fill(const SparseBatch::Inst &inst) { for (bst_uint i = 0; i < inst.length; ++i) { - data[inst[i].findex].fvalue = inst[i].fvalue; + data[inst[i].index].fvalue = inst[i].fvalue; } } /*! \brief drop the trace after fill, must be called after fill */ inline void Drop(const SparseBatch::Inst &inst) { for (bst_uint i = 0; i < inst.length; ++i) { - data[inst[i].findex].flag = -1; + data[inst[i].index].flag = -1; } } /*! \brief get ith value */ diff --git a/src/tree/updater.h b/src/tree/updater.h index 91e9c4079..b33ee1833 100644 --- a/src/tree/updater.h +++ b/src/tree/updater.h @@ -62,8 +62,6 @@ inline IUpdater* CreateUpdater(const char *name) { if (!strcmp(name, "prune")) return new TreePruner(); if (!strcmp(name, "refresh")) return new TreeRefresher(); if (!strcmp(name, "grow_colmaker")) return new ColMaker(); - if (!strcmp(name, "grow_colmaker2")) return new ColMaker >(); - if (!strcmp(name, "grow_colmaker5")) return new ColMaker >(); utils::Error("unknown updater:%s", name); return NULL; }