-
Notifications
You must be signed in to change notification settings - Fork 0
/
pfastreXML.sh
executable file
·32 lines (25 loc) · 1.23 KB
/
pfastreXML.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
dir="FastXML_PfastreXML"
dataset=$1
data_dir="data/$dataset"
results_dir="results/$dataset"
model_dir="results/$dataset/model"
mkdir results/ ;
mkdir $results_dir ;
mkdir $model_dir ;
trn_ft_file="${data_dir}/trn_X_Xf.txt"
trn_lbl_file="${data_dir}/trn_X_Y.txt"
tst_ft_file="${data_dir}/tst_X_Xf.txt"
tst_lbl_file="${data_dir}/tst_X_Y.txt"
inv_prop_file="${data_dir}/inv_prop.txt"
score_file="${results_dir}/score_mat.txt"
matlab -nodesktop -nodisplay -r "cd('$PWD'); addpath(genpath('$dir/Tools'));trn_X_Y = read_text_mat('$trn_lbl_file');wts = inv_propensity(trn_X_Y,0.55,1.5);exit;"
#write_text_mat(wts, '$inv_prop_file');exit;"
perl $dir/Tools/convert_format.pl $data_dir/train.txt $trn_ft_file $trn_lbl_file
perl $dir/Tools/convert_format.pl $data_dir/test.txt $tst_ft_file $tst_lbl_file
# training
# Reads training features (in $trn_ft_file), training labels (in $trn_lbl_file), and writes FastXML model to $model_dir
./$dir/PfastreXML/PfastreXML_train $trn_ft_file $trn_lbl_file $inv_prop_file $model_dir -T 5 -t 5 #-b 1.0 -c 1.0 -m 10 -l 10
# testing
# Reads test features (in $tst_ft_file), FastXML model (in $model_dir), and writes test label scores to $score_file
./$dir/PfastreXML/PfastreXML_test $tst_ft_file $score_file $model_dir