add remove tree

This commit is contained in:
tqchen
2014-03-11 11:25:50 -07:00
parent 364b4a0f77
commit 377a573097
5 changed files with 45 additions and 14 deletions

18
demo/test/mushroom.conf Normal file
View File

@@ -0,0 +1,18 @@
num_round=2
save_period=0
data = "agaricus.txt.train"
eval[test] = "agaricus.txt.test"
test:data = "agaricus.txt.test"
booster_type = 0
loss_type = 2
bst:tree_maker=2
bst:eta=1.0
bst:gamma=1.0
bst:min_child_weight=1
bst:max_depth=3

View File

@@ -8,22 +8,20 @@ python mknfold.py agaricus.txt 1
../../xgboost mushroom.conf task=dump model_in=full.model fmap=featmap.txt name_dump=dump.full.txt
# training
../../xgboost mushroom.conf num_round=1 model_out=m1.model bst:max_depth=1
../../xgboost mushroom.conf num_round=2 model_out=m1.model bst:max_depth=1
# this is what dump will looklike with feature map
../../xgboost mushroom.conf task=dump model_in=m1.model fmap=featmap.txt name_dump=dump.m1.txt
# 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=m2.model model_out=m3.model interact:booster_index=0 bst:interact:expand=2
../../xgboost mushroom.conf task=interact model_in=m3.model model_out=m3v.model interact:booster_index=0 bst:interact:remove=2
../../xgboost mushroom.conf task=interact model_in=m3v.model model_out=m3p.model interact:booster_index=0 bst:interact:expand=2
../../xgboost mushroom.conf task=interact model_in=m2.model model_out=m3.model interact:booster_index=0 interact:action=remove
# 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=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=m3v.model fmap=featmap.txt name_dump=dump.m3v.txt
../../xgboost mushroom.conf task=dump model_in=m3p.model fmap=featmap.txt name_dump=dump.m3p.txt
echo "========m1======="
cat dump.m1.txt
@@ -34,11 +32,7 @@ cat dump.m2.txt
echo "========m3========"
cat dump.m3.txt
echo "========m3v========"
cat dump.m3v.txt
echo "========m3p========"
cat dump.m3p.txt
echo "========full======="
cat dump.full.txt