change input data structure

This commit is contained in:
tqchen
2014-02-26 11:51:58 -08:00
parent 6fa5c30777
commit 9b09cd3d49
9 changed files with 204 additions and 129 deletions

View File

@@ -117,8 +117,7 @@ namespace xgboost{
this->GetGradient( preds, train_->labels, grad, hess );
std::vector<unsigned> root_index;
booster::FMatrixS::Image train_image( train_->data );
base_model.DoBoost(grad,hess,train_image,root_index);
base_model.DoBoost(grad,hess,train_->data,root_index);
}
/*!
* \brief evaluate the model for specific iteration

View File

@@ -132,8 +132,8 @@ namespace xgboost{
for( size_t i = 0; i < data.NumRow(); i ++ ){
booster::FMatrixS::Line sp = data[i];
for( unsigned j = 0; j < sp.len; j ++ ){
if( num_feature <= sp.findex[j] ){
num_feature = sp.findex[j] + 1;
if( num_feature <= sp[j].findex ){
num_feature = sp[j].findex + 1;
}
}
}