Learn R Programming

bingat (version 1.2.2)

gaConsensus: Genetic Algorithm Consensus Solution

Description

Runs a Genetic Algorithm to find nodes or edges that separate groups

Usage

gaConsensus(data, groups, iters = 10, nRuns = 1, popSize = 200, 
		method = "manhattan", parallel = FALSE, cores = 3)

Arguments

data

A data frame in which the columns (subjects) contain a 0/1 value for row (Node or Edge).

groups

A vector of 0/1s used to denote the group membership of columns in the data.

iters

The number of iterations (ideally, 1000 or more).

nRuns

The number of times to repeat the GA to get a consensus.

popSize

The population size.

method

The distance metric to use.

parallel

TRUE or FALSE depending on whether the analysis will be parallelized for speed.

cores

The number of cores to use for parallelization. Ignored if parallel = FALSE.

Value

A list containing all the solutions from the last run(s) of the GA and their correlation values

See Also

rbga.bin.

Examples

Run this code
	data(braingraphs)
	
	grps <- c(rep(0, 19), rep(1, 19))
	iters <- 1 ### This is set low for speed
	nRuns <- 1 ### This is set low for speed
	
	consensus <- gaConsensus(braingraphs, grps, iters, nRuns) 
	consensus$corr[1:5]
	consensus$solutions[1:2,]

Run the code above in your browser using DataLab