gen.config: Generate configuration files for platypus

Description Usage Arguments Value Examples

View source: R/gen.config.R

Description

Generate configuration files for platypus

Usage

1
2
3
gen.config(view.data, tasks, config.loc = "config",
  model.type = c("en", "rf", "svm"), view.filenames = NA,
  view.names = NA, ignore.label = "intermediate", store = FALSE)

Arguments

view.data

List of view data matrices. Must be named.

tasks

File containing all task labels, one column per task

config.loc

Where the config files should be stored

model.type

Type of classifier to use (select from en, rf, svm)

view.filenames

List of files containing view feature data

view.names

List of names for each view

ignore.label

Label to ignore in the task file (default 'intermediate')

store

Whether to store configs to file or not. Default FALSE.

Value

List of config filenames, for use in platypus

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
X1 <- matrix(rnorm(10000), nrow=100)
rownames(X1) <- paste0('Sample',seq(nrow(X1)))
colnames(X1) <- paste0('Feature',seq(ncol(X1)))
X2 <- matrix(rnorm(10000), nrow=100)
rownames(X2) <- paste0('Sample',seq(nrow(X2)))
colnames(X2) <- paste0('Feature',seq(ncol(X2)))
X3 <- matrix(rnorm(10000), nrow=100)
rownames(X3) <- paste0('Sample',seq(nrow(X3)))
colnames(X3) <- paste0('Feature',seq(ncol(X3)))
y <- sample(c('MOO','OINK',NA),100,replace=TRUE)
names(y) <- paste0('Sample',seq(max(nrow(X1), nrow(X2),nrow(X3))))

# Group together view and task data
view.data <- list(Farm=X1, Lion=X2, Cat=X3)
tasks <- as.data.frame(y)

# Pretend we loaded this data from some files
fn.view.names <- list(Farm='Farm.tsv', Lion='Lion.tsv', Cat='Cat.tsv')

# Generate config files
# If the data files don't already exist, use this
configs <- gen.config(view.data, tasks[,1,drop=FALSE], model.type='en', config.loc='config')

# Generate config files
gen.config(view.data[1], tasks[,1,drop=FALSE], model.type='en',config.loc='.')
gen.config(view.data, tasks, model.type='en', view.filenames=fn.view.names,config.loc='.')
gen.config(view.data, tasks, model.type='en',config.loc='.') 
gen.config(view.data, tasks, model.type='svm',config.loc='.')
gen.config(view.data, tasks, model.type='rf',config.loc='.')

graim/PLATYPUS documentation built on Oct. 4, 2019, 2:05 p.m.