rank pass toy

This commit is contained in:
kalenhaha
2014-04-07 23:25:35 +08:00
parent 40c380e40a
commit a10f594644
32 changed files with 2237 additions and 2146 deletions

13
demo/rank/README Normal file
View File

@@ -0,0 +1,13 @@
Demonstrating how to use XGBoost accomplish regression tasks on computer hardware dataset https://archive.ics.uci.edu/ml/datasets/Computer+Hardware
Run: ./runexp.sh
Format of input: LIBSVM format
Format of ```featmap.txt: <featureid> <featurename> <q or i or int>\n ```:
- Feature id must be from 0 to number of features, in sorted order.
- i means this feature is binary indicator feature
- q means this feature is a quantitative value, such as age, time, can be missing
- int means this feature is integer value (when int is hinted, the decision boundary will be integer)
Explainations: https://github.com/tqchen/xgboost/wiki/Regression

16
demo/rank/runexp.sh Normal file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
# map the data to features. For convenience we only use 7 original attributes and encode them as features in a trivial way
python mapfeat.py
# split train and test
python mknfold.py machine.txt 1
# training and output the models
../../xgboost machine.conf
# output predictions of test data
../../xgboost machine.conf task=pred model_in=0002.model
# print the boosters of 0002.model in dump.raw.txt
../../xgboost machine.conf task=dump model_in=0002.model name_dump=dump.raw.txt
# print the boosters of 0002.model in dump.nice.txt with feature map
../../xgboost machine.conf task=dump model_in=0002.model fmap=featmap.txt name_dump=dump.nice.txt
# cat the result
cat dump.nice.txt

5
demo/rank/toy.eval Normal file
View File

@@ -0,0 +1,5 @@
1 0:2 1:3 2:2
0 0:2 1:3 2:2
0 0:2 1:3 2:2
0 0:2 1:3 2:2
1 0:2 1:3 2:2

2
demo/rank/toy.eval.group Normal file
View File

@@ -0,0 +1,2 @@
2
3

5
demo/rank/toy.test Normal file
View File

@@ -0,0 +1,5 @@
1 0:2 1:3 2:2
0 0:2 1:3 2:2
0 0:2 1:3 2:2
0 0:2 1:3 2:2
1 0:2 1:3 2:2

2
demo/rank/toy.test.group Normal file
View File

@@ -0,0 +1,2 @@
2
3

5
demo/rank/toy.train Normal file
View File

@@ -0,0 +1,5 @@
1 0:2 1:3 2:2
0 0:2 1:3 2:2
0 0:2 1:3 2:2
0 0:2 1:3 2:2
1 0:2 1:3 2:2

View File

@@ -0,0 +1,2 @@
2
3

0
demo/rank/train Normal file
View File