-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetAUC.pl
More file actions
executable file
·43 lines (32 loc) · 940 Bytes
/
getAUC.pl
File metadata and controls
executable file
·43 lines (32 loc) · 940 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
#!/usr/bin/perl -w
use Flat;
use math;
use Util;
use Getopt::Std;
my $cmdLine = Util::getCmdLine();
my(%options);
getopts("o:g:", \%options);
my($grf) = "pdf";
if(exists $options{"g"}) {
$grf = $options{"g"};
}
my($op) = "";
if(exists $options{"o"}) {
$op = $options{"o"};
}
if(scalar(@ARGV) != 4) {
print "Usage: ~ [-o operation_on-predFld] [-g jpeg|png|...|pdf|postscript] <in.csv> <labelField> <predField> <out.csv>\n";
print " -o operation to be specified on predField. e.g. '-'\n";
print " -g graphics device. Default is 'pdf'\n\n";
exit(1);
}
my $in = Flat->new1(shift @ARGV);
my $lfld = $in->getFieldIndex(shift @ARGV);
my $pfld = $in->getFieldIndex(shift @ARGV);
my $out = shift @ARGV;
my $auc = math::util::getAUC($in->getFileName(), $lfld, $pfld, $grf, $op);
open OUT, "+>$out" or die "Cannot open $out\n";
print OUT "# $cmdLine\n";
print OUT "AUC\n";
print OUT "$auc\n";
close OUT;