Last data update: 2014.03.03

R: Weighted Rank Aggregation via brute force algorithm
BruteAggregR Documentation

Weighted Rank Aggregation via brute force algorithm

Description

Weighted rank aggregation of ordered lists is performed using the brute force approach, i.e. generating all possible ordered lists and finding the list with the minimum value of the objective function

Usage

BruteAggreg(x, k, weights = NULL, distance = c("Spearman", "Kendall"),
            importance=rep(1,nrow(x)))

Arguments

x

a matrix of ordered lists to be combined (lists must be in rows)

k

size of the top-k list

weights

scores (weights) to be used in the aggregation process

distance

distance which "measures" the similarity between the ordered lists

importance

a vector of weights indicating the importance of each ordered list in x

Details

The function performs rank aggregation using the old-fashion brute force approach. This approach works for small problems only and should not be attempted if k is relatively large (k > 10). To generate all possible ordered lists, the permutation function from the gtools package is used. Both weighted and unweighted rank aggregation can be performed. Please refer to the documentation for RankAggreg function as the same constraints on x and index.weights apply to both functions.

Value

top.list

Top-k aggregated list

optimal.value

the minimum value of the objective function corresponding to the top-k list

distance

distance used by the algorithm

method

method used: BruteForce

importance

importance vector used

lists

original lists to be combined

weights

scaled weights used in aggregation

sample

objective function values

sample.size

number of all possible solutions

summary

contains minimum and median values of sample

Author(s)

Vasyl Pihur, Somnath Datta, Susmita Datta

References

Pihur, V., Datta, S., and Datta, S. (2007) "Weighted rank aggregation of cluster validation measures: a Monte Carlo cross-entropy approach" Bioinformatics, 23(13):1607-1615

See Also

RankAggreg

Examples

require(gtools)

# rank aggregation without weights
x <- matrix(c("A", "B", "C", "D", "E",
        "B", "D", "A", "E", "C",
        "B", "A", "E", "C", "D",
        "A", "D", "B", "C", "E"), byrow=TRUE, ncol=5)

(toplist <- BruteAggreg(x, 5))

# weighted rank aggregation
set.seed(100)
w <- matrix(rnorm(20), ncol=5)
w <- t(apply(w, 1, sort))

(toplist <- BruteAggreg(x,5,w,"Spearman")) # using the Spearman distance
(toplist <- BruteAggreg(x,5,w,"Kendall")) #using the Kendall distance
plot(toplist)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(RankAggreg)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RankAggreg/BruteAggreg.Rd_%03d_medium.png", width=480, height=480)
> ### Name: BruteAggreg
> ### Title: Weighted Rank Aggregation via brute force algorithm
> ### Aliases: BruteAggreg
> ### Keywords: optimize robust
> 
> ### ** Examples
> 
> require(gtools)
Loading required package: gtools
> 
> # rank aggregation without weights
> x <- matrix(c("A", "B", "C", "D", "E",
+         "B", "D", "A", "E", "C",
+         "B", "A", "E", "C", "D",
+         "A", "D", "B", "C", "E"), byrow=TRUE, ncol=5)
> 
> (toplist <- BruteAggreg(x, 5))
The optimal list is: 
        A B D C E

  Algorithm:   BruteForce
  Distance:    Spearman
  Score:       4 
> 
> # weighted rank aggregation
> set.seed(100)
> w <- matrix(rnorm(20), ncol=5)
> w <- t(apply(w, 1, sort))
> 
> (toplist <- BruteAggreg(x,5,w,"Spearman")) # using the Spearman distance
The optimal list is: 
        B A D C E

  Algorithm:   BruteForce
  Distance:    Spearman
  Score:       0.8934616 
> (toplist <- BruteAggreg(x,5,w,"Kendall")) #using the Kendall distance
The optimal list is: 
        A B D C E

  Algorithm:   BruteForce
  Distance:    Kendall
  Score:       0.05868012 
> plot(toplist)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>