Hi all,
I have a problem to count the majority selectedresult for each pair of string (sysA,sysB). for each query, i have 3 different combination of string comparision.
* comparison("lucene-std-rel","lucene-noLen-rr");
* comparison("lucene-noLen-rr","lucene-std-rel");
* comparison("lucene-noLen-rr","random");
my code: it seems just count if user choose either sysA, sysB or both without considering the 3 different pair.
code:
( $file = <INFILE> ) {
@field = parse_csv($file);
chomp(@field);
@query = $field[1];
for($i=0;$i<@query;++$i) {
if ( ($field[2] eq $method) || ($field[3] eq $method)){
if ( $field[4] eq $field[2]) {
print "$query[$i]: $field[2], $field[3], $field[4]\n";
$counta++;
}
if ( $field[4] eq $field[3]) {
print "$query[$i]: $field[2], $field[3]: $field[4]\n";
$countb++;
}
if ( $field[4] eq ($field[2] && $field[3])) {
#print "$query[$i]: $field[2]$field[3]\n";
$countc++;
}
Data:5 field> user,query,sysA,sysB,selectedresult
* user1,male,lucene-std-rel,random,lucene-std-relrandom
o user2,male,lucene-std-rel,random,lucene-std-rel
o user3,male,lucene-std-rel,random,lucene-std-rel
o user4,male,lucene-std-rel,random,lucene-std-rel
o user5,male,lucene-std-rel,random,lucene-std-relrandom
o user6,male,lucene-std-rel,random,lucene-std-rel
o user7,male,lucene-std-rel,random,lucene-std-rel
example output required: query 1:male fitness models
lucene-std-rel:5, random:0, both:2 ---> majority:lucene-std-rel
any help is very much appreciated.
I have a problem to count the majority selectedresult for each pair of string (sysA,sysB). for each query, i have 3 different combination of string comparision.
* comparison("lucene-std-rel","lucene-noLen-rr");
* comparison("lucene-noLen-rr","lucene-std-rel");
* comparison("lucene-noLen-rr","random");
my code: it seems just count if user choose either sysA, sysB or both without considering the 3 different pair.
code:
( $file = <INFILE> ) {
@field = parse_csv($file);
chomp(@field);
@query = $field[1];
for($i=0;$i<@query;++$i) {
if ( ($field[2] eq $method) || ($field[3] eq $method)){
if ( $field[4] eq $field[2]) {
print "$query[$i]: $field[2], $field[3], $field[4]\n";
$counta++;
}
if ( $field[4] eq $field[3]) {
print "$query[$i]: $field[2], $field[3]: $field[4]\n";
$countb++;
}
if ( $field[4] eq ($field[2] && $field[3])) {
#print "$query[$i]: $field[2]$field[3]\n";
$countc++;
}
Data:5 field> user,query,sysA,sysB,selectedresult
* user1,male,lucene-std-rel,random,lucene-std-relrandom
o user2,male,lucene-std-rel,random,lucene-std-rel
o user3,male,lucene-std-rel,random,lucene-std-rel
o user4,male,lucene-std-rel,random,lucene-std-rel
o user5,male,lucene-std-rel,random,lucene-std-relrandom
o user6,male,lucene-std-rel,random,lucene-std-rel
o user7,male,lucene-std-rel,random,lucene-std-rel
example output required: query 1:male fitness models
lucene-std-rel:5, random:0, both:2 ---> majority:lucene-std-rel
any help is very much appreciated.