line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Algorithm::RankAggregate::BordaRank; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
5217
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
127
|
|
4
|
3
|
|
|
3
|
|
17
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
155
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.0.3_00'; |
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
17
|
use base qw/Algorithm::RankAggregate::BordaCount/; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
1887
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub aggregate_rank_to_rank { |
10
|
3
|
|
|
3
|
1
|
12
|
my ($this, $ranked_lists_list, $top_k_num) = @_; |
11
|
3
|
|
|
|
|
6
|
my @result = (); |
12
|
3
|
50
|
|
|
|
6
|
my $bordacount_result_list = $this->aggregate_rank_to_count($ranked_lists_list, $top_k_num) if (@{$ranked_lists_list}); |
|
3
|
|
|
|
|
47
|
|
13
|
3
|
50
|
|
|
|
5
|
@result = @{$this->get_ranked_list($bordacount_result_list)} if (@{$bordacount_result_list}); |
|
3
|
|
|
|
|
25
|
|
|
3
|
|
|
|
|
22
|
|
14
|
3
|
|
|
|
|
39
|
return \@result; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub aggregate_score_to_rank { |
18
|
2
|
|
|
2
|
1
|
11
|
my ($this, $score_lists_list, $top_k_num) = @_; |
19
|
2
|
|
|
|
|
5
|
my @result = (); |
20
|
2
|
|
|
|
|
17
|
my $ranked_lists_list = $this->get_ranked_lists_list($score_lists_list); |
21
|
2
|
50
|
|
|
|
3
|
@result = @{$this->aggregate_rank_to_rank($ranked_lists_list, $top_k_num)} if (@{$ranked_lists_list}); |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
8
|
|
22
|
2
|
|
|
|
|
8
|
return \@result; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub aggregate { |
26
|
1
|
|
|
1
|
1
|
6
|
my ($this, $score_lists_list, $top_k_num) = @_; |
27
|
1
|
|
|
|
|
2
|
my @result = (); |
28
|
1
|
50
|
|
|
|
7
|
return \@result unless ($this->validate_lists_list($score_lists_list)); |
29
|
1
|
50
|
|
|
|
3
|
@result = @{$this->aggregate_score_to_rank($score_lists_list, $top_k_num)} if (@{$score_lists_list}); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4
|
|
30
|
1
|
|
|
|
|
5
|
return \@result; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
__END__ |