From bb93c0aaac8ef3266645a8df72a856c5a4020798 Mon Sep 17 00:00:00 2001 From: tqchen Date: Wed, 30 Apr 2014 09:32:42 -0700 Subject: [PATCH] add rank --- regrank/xgboost_regrank_obj.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/regrank/xgboost_regrank_obj.hpp b/regrank/xgboost_regrank_obj.hpp index 4cfcb5ae1..45f05dd2b 100644 --- a/regrank/xgboost_regrank_obj.hpp +++ b/regrank/xgboost_regrank_obj.hpp @@ -81,7 +81,8 @@ namespace xgboost{ rec.clear(); for(unsigned j = gptr[k]; j < gptr[k+1]; ++j ){ rec.push_back( std::make_pair(info.labels[j], j) ); - } + grad[j] = hess[j] = 0.0f; + } std::sort( rec.begin(), rec.end(), CmpFirst ); // enumerate buckets with same label, for each item in the list, grab another sample randomly for( unsigned i = 0; i < rec.size(); ){