consensus_evaluate: Evaluate, trim, and reweigh algorithms

Description Usage Arguments Details Value Examples

View source: R/consensus_evaluate.R

Description

Evaluates algorithms on internal/external validation indices. Poor performing algorithms can be trimmed from the ensemble. The remaining algorithms can be given weights before use in consensus functions.

Usage

1
2
consensus_evaluate(data, ..., cons.cl = NULL, ref.cl = NULL,
  k.method = NULL, plot = FALSE, trim = FALSE, reweigh = FALSE, n = 5)

Arguments

data

data matrix with rows as samples and columns as variables

...

any number of objects outputted from consensus_cluster()

cons.cl

matrix of cluster assignments from consensus functions such as kmodes and majority_voting

ref.cl

reference class

k.method

determines the method to choose k when no reference class is given. When ref.cl is not NULL, k is the number of distinct classes of ref.cl. Otherwise the input from k.method chooses k. The default is to use the PAC to choose the best k(s). Specifying an integer as a user-desired k will override the best k chosen by PAC. Finally, specifying "all" will produce consensus results for all k. The "all" method is implicitly performed when there is only one k used.

plot

logical; if TRUE, graph_all is called

trim

logical; if TRUE, algorithms that score low on internal indices will be trimmed out

reweigh

logical; if TRUE, after trimming out poor performing algorithms, each algorithm is reweighed depending on its internal indices.

n

an integer specifying the top n algorithms to keep after trimming off the poor performing ones using Rank Aggregation. If the total number of algorithms is less than n no trimming is done.

Details

This function always returns internal indices. If ref.cl is not NULL, external indices are additionally shown. Relevant graphical displays are also outputted. Algorithms are ranked across internal indices using Rank Aggregation. Only the top n algorithms are kept, the rest are trimmed.

Value

consensus_evaluate returns a list with the following elements

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Consensus clustering for multiple algorithms
set.seed(911)
x <- matrix(rnorm(500), ncol = 10)
CC <- consensus_cluster(x, nk = 3:4, reps = 10, algorithms = c("ap", "km"),
progress = FALSE)

# Evaluate algorithms on internal/external indices and trim algorithms:
# remove those ranking low on internal indices
set.seed(1)
ref.cl <- sample(1:4, 50, replace = TRUE)
z <- consensus_evaluate(x, CC, ref.cl = ref.cl, n = 1, trim = TRUE)
str(z, max.level = 2)

diceR documentation built on June 11, 2018, 5:04 p.m.