ok
This commit is contained in:
parent
966416e69c
commit
2f95968a1c
29
multi-node/hadoop/run_hadoop_mushroom.sh
Executable file
29
multi-node/hadoop/run_hadoop_mushroom.sh
Executable file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$#" -lt 2 ];
|
||||
then
|
||||
echo "Usage: <num_of_slave_nodes> <path_in_HDFS>"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# put the local training file to HDFS
|
||||
hadoop fs -mkdir $2/data
|
||||
hadoop fs -put ../../demo/data/agaricus.txt.train $2/data
|
||||
|
||||
# training and output the final model file
|
||||
../../rabit/tracker/rabit_hadoop.py -n $1 -i $2/data/agaricus.txt.train \
|
||||
-o $2/model -f ../../demo/data/agaricus.txt.test \
|
||||
../../xgboost mushroom.hadoop.conf dsplit=row
|
||||
|
||||
# get the final model file
|
||||
hadoop fs -get $2/model/part-00000 ./final.model
|
||||
|
||||
# output prediction task=pred
|
||||
../../xgboost mushroom.hadoop.conf task=pred model_in=final.model \
|
||||
test:data=../../demo/data/agaricus.txt.test
|
||||
# print the boosters of final.model in dump.raw.txt
|
||||
../../xgboost mushroom.hadoop.conf task=dump model_in=final.model name_dump=dump.raw.txt
|
||||
# use the feature map in printing for better visualization
|
||||
../../xgboost mushroom.hadoop.conf task=dump model_in=final.model \
|
||||
fmap=../../demo/data/featmap.txt name_dump=dump.nice.txt
|
||||
cat dump.nice.txt
|
||||
Loading…
x
Reference in New Issue
Block a user