small change

This commit is contained in:
kalenhaha 2014-05-11 14:25:30 +08:00
parent faf35c409e
commit 6648a15817
2 changed files with 35 additions and 16 deletions

View File

@ -1,16 +0,0 @@
#!/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

35
demo/rank/toy.conf Normal file
View File

@ -0,0 +1,35 @@
# General Parameters, see comment for each definition
# choose the tree booster, 0: tree, 1: linear
booster_type = 0
# this is the only difference with classification, use 0: linear regression
# when labels are in [0,1] we can also use 1: logistic regression
loss_type = 0
objective="rank:pairwise"
#objective="rank:softmax"
#objective="lambdarank:map"
#objective="lambdarank:ndcg"
# Tree Booster Parameters
# step size shrinkage
bst:eta = 1.0
# minimum loss reduction required to make a further partition
bst:gamma = 1.0
# minimum sum of instance weight(hessian) needed in a child
bst:min_child_weight = 1
# maximum depth of a tree
bst:max_depth = 3
# Task parameters
# the number of round to do boosting
num_round = 2
# 0 means do not save any model except the final round model
save_period = 0
# The path of training data
data = "toy.train"
# The path of validation data, used to monitor training process, here [test] sets name of the validation set
eval[test] = "toy.eval"
# The path of test data
test:data = "toy.test"