fix delete
This commit is contained in:
parent
8f16ef8e75
commit
19b28b978d
@ -227,7 +227,7 @@ namespace xgboost{
|
|||||||
utils::Assert( bid >= 0 && bid < (int)boosters.size(), "interact:booster_index exceed existing bound" );
|
utils::Assert( bid >= 0 && bid < (int)boosters.size(), "interact:booster_index exceed existing bound" );
|
||||||
psum -= boosters[ bid ]->Predict( feats, row_index, root_index );
|
psum -= boosters[ bid ]->Predict( feats, row_index, root_index );
|
||||||
if( mparam.do_reboost == 0 && buffer_index >= 0 ){
|
if( mparam.do_reboost == 0 && buffer_index >= 0 ){
|
||||||
this->pred_buffer[ buffer_index ] = psum;
|
this->pred_buffer[ buffer_index ] = psum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return psum;
|
return psum;
|
||||||
@ -238,9 +238,11 @@ namespace xgboost{
|
|||||||
utils::Assert( bid >= 0 && bid < mparam.num_boosters , "must specify booster index for deletion");
|
utils::Assert( bid >= 0 && bid < mparam.num_boosters , "must specify booster index for deletion");
|
||||||
delete boosters[ bid ];
|
delete boosters[ bid ];
|
||||||
for( int i = bid + 1; i < mparam.num_boosters; ++ i ){
|
for( int i = bid + 1; i < mparam.num_boosters; ++ i ){
|
||||||
boosters[ i - 1 ] = boosters[ i ];
|
boosters[i-1] = boosters[ i ];
|
||||||
|
booster_info[i-1] = booster_info[ i ];
|
||||||
}
|
}
|
||||||
boosters.resize( mparam.num_boosters -= 1 );
|
boosters.resize( mparam.num_boosters -= 1 );
|
||||||
|
booster_info.resize( boosters.size() );
|
||||||
}
|
}
|
||||||
/*! \brief update the prediction buffer, after booster have been updated */
|
/*! \brief update the prediction buffer, after booster have been updated */
|
||||||
inline void InteractRePredict( const FMatrixS &feats, bst_uint row_index, int buffer_index = -1, unsigned root_index = 0 ){
|
inline void InteractRePredict( const FMatrixS &feats, bst_uint row_index, int buffer_index = -1, unsigned root_index = 0 ){
|
||||||
|
|||||||
@ -16,12 +16,13 @@ python mknfold.py agaricus.txt 1
|
|||||||
# interaction
|
# interaction
|
||||||
../../xgboost mushroom.conf task=interact model_in=m1.model model_out=m2.model interact:booster_index=0 bst:interact:expand=1
|
../../xgboost mushroom.conf task=interact model_in=m1.model model_out=m2.model interact:booster_index=0 bst:interact:expand=1
|
||||||
../../xgboost mushroom.conf task=interact model_in=m2.model model_out=m3.model interact:booster_index=0 interact:action=remove
|
../../xgboost mushroom.conf task=interact model_in=m2.model model_out=m3.model interact:booster_index=0 interact:action=remove
|
||||||
|
../../xgboost mushroom.conf task=interact model_in=m3.model model_out=m4.model interact:booster_index=0 bst:interact:expand=2
|
||||||
|
|
||||||
# this is what dump will looklike with feature map
|
# this is what dump will looklike with feature map
|
||||||
../../xgboost mushroom.conf task=dump model_in=m1.model fmap=featmap.txt name_dump=dump.m2.txt
|
../../xgboost mushroom.conf task=dump model_in=m1.model fmap=featmap.txt name_dump=dump.m2.txt
|
||||||
../../xgboost mushroom.conf task=dump model_in=m2.model fmap=featmap.txt name_dump=dump.m2.txt
|
../../xgboost mushroom.conf task=dump model_in=m2.model fmap=featmap.txt name_dump=dump.m2.txt
|
||||||
../../xgboost mushroom.conf task=dump model_in=m3.model fmap=featmap.txt name_dump=dump.m3.txt
|
../../xgboost mushroom.conf task=dump model_in=m3.model fmap=featmap.txt name_dump=dump.m3.txt
|
||||||
|
../../xgboost mushroom.conf task=dump model_in=m4.model fmap=featmap.txt name_dump=dump.m4.txt
|
||||||
|
|
||||||
echo "========m1======="
|
echo "========m1======="
|
||||||
cat dump.m1.txt
|
cat dump.m1.txt
|
||||||
@ -32,6 +33,9 @@ cat dump.m2.txt
|
|||||||
echo "========m3========"
|
echo "========m3========"
|
||||||
cat dump.m3.txt
|
cat dump.m3.txt
|
||||||
|
|
||||||
|
echo "========m4========"
|
||||||
|
cat dump.m4.txt
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo "========full======="
|
echo "========full======="
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user