-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcsv.svm_xval.pl
More file actions
executable file
·48 lines (38 loc) · 942 Bytes
/
csv.svm_xval.pl
File metadata and controls
executable file
·48 lines (38 loc) · 942 Bytes
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/perl -w
sub printUsage {
print "Crossvalidate with the specified # of iteration using svm\n\n";
print "Usage: ~ [-o svm_learn options] -i <iteration> (-n <#_to_train>|-p <%_to_train>) <in.csv> <label> <pred1> ... <predN> <out.csv>\n";
exit(1);
}
use Util;
use Getopt::Std;
my $cmdLine = Util::getCmdLine();
my(%options);
getopts("o:i:n:p:", \%options);
my $opts = "";
if(exists $options{"o"}) {
$opts = "-o '".$options{"o"}."'";
}
my $iter = "";
if(exists $options{"i"}) {
$iter = "-i ".$options{"i"};
}
else {
print "csv.svm_xval.pl: -i has to be specified\n";
printUsage();
}
my $n = "";
if(exists $options{"n"}) {
$n = $options{"n"};
}
elsif(exists $options{"p"}) {
$n = "-p ".$options{"p"};
}
else {
print "-n or -p has to be specified\n";
printUsage();
}
if(scalar(@ARGV) < 4) {
printUsage();
}
Util::run("csv.xval.pl -c \"csv.svm_test.pl $opts\" $iter $n @ARGV", 1);