to_list: Convert galgo.Obj to list

Description Usage Arguments Value Author(s) Examples

View source: R/convert-functions.R

Description

The current function transforms a galgo.Obj to a list

Usage

1
to_list(output)

Arguments

output

An object of class galgo.Obj

Value

The current function restructurates a galgo.Obj to a more easy to understand an use list. This output is particularly useful if one wants to select a given solution and use its outputs in a new classifier. The output of type list has a length equals to the number of solutions obtained by the galgo algorithm.

Basically this output is a list of lists, where each element of the output is named after the solution's name (solution.n, where n is the number assigned to that solution), and inside of it, it has all the constituents for that given solution with the following structure:

  1. output$solution.n$Genes: A vector of the features included in the solution

  2. output$solution.n$k: The number of partitions found in that solution

  3. output$solution.n$SC.Fit: The average silhouette coefficient of the partitions found

  4. output$solution.n$Surv.Fit: The survival fitness value

  5. output$solution.n$Rank: The solution rank

  6. CrowD: The solution crowding distance related to the rest of the solutions

Author(s)

Martin E Guerrero-Gimenez, mguerrero@mendoza-conicet.gob.ar

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# load example dataset
library(breastCancerTRANSBIG)
data(transbig)
Train <- transbig
rm(transbig)

expression <- Biobase::exprs(Train)
clinical <- Biobase::pData(Train)
OS <- survival::Surv(time = clinical$t.rfs, event = clinical$e.rfs)

# We will use a reduced dataset for the example
expression <- expression[sample(1:nrow(expression), 100), ]

# Now we scale the expression matrix
expression <- t(scale(t(expression)))

# Run galgo
output <- GSgalgoR::galgo(generations = 5, population = 15, 
prob_matrix = expression, OS = OS)
outputDF <- to_dataframe(output)
outputList <- to_list(output)

harpomaxx/GSgalgoR documentation built on Oct. 25, 2020, 3:47 p.m.