... | ... |
@@ -521,17 +521,6 @@ Using an ordinary GLM instead.") |
521 | 521 |
classifier |
522 | 522 |
} |
523 | 523 |
|
524 |
-###################################### |
|
525 |
-###################################### |
|
526 |
-#' A function to generate a CrossValParams object |
|
527 |
-#' |
|
528 |
-#' @inheritParams crossValidate |
|
529 |
-#' |
|
530 |
-#' @return CrossValParams object |
|
531 |
-#' |
|
532 |
-#' @examples |
|
533 |
-#' CVparams <- generateCrossValParams(nRepeats = 20, nFolds = 5, nCores = 8, selectionOptimisation = "none") |
|
534 |
-#' @import BiocParallel |
|
535 | 524 |
generateCrossValParams <- function(nRepeats, nFolds, nCores, selectionOptimisation){ |
536 | 525 |
|
537 | 526 |
seed <- .Random.seed[1] |
... | ... |
@@ -554,31 +543,7 @@ generateCrossValParams <- function(nRepeats, nFolds, nCores, selectionOptimisati |
554 | 543 |
if(!any(tuneMode %in% c("Resubstitution", "Nested CV", "none"))) stop("selectionOptimisation must be Nested CV or Resubstitution or none") |
555 | 544 |
CrossValParams(permutations = nRepeats, folds = nFolds, parallelParams = BPparam, tuneMode = tuneMode) |
556 | 545 |
} |
557 |
-###################################### |
|
558 | 546 |
|
559 |
-###################################### |
|
560 |
-#' A function to generate a ModellingParams object |
|
561 |
-#' |
|
562 |
-#' @inheritParams crossValidate |
|
563 |
-#' @param assayIDs A vector of data set identifiers as long at the number of data sets. |
|
564 |
-#' |
|
565 |
-#' @return ModellingParams object |
|
566 |
-#' |
|
567 |
-#' @examples |
|
568 |
-#' data(asthma) |
|
569 |
-#' # First make a toy example assay with multiple data types. We'll randomly assign different features to be clinical, gene or protein. |
|
570 |
-#' set.seed(51773) |
|
571 |
-#' measurements <- DataFrame(measurements, check.names = FALSE) |
|
572 |
-#' mcols(measurements)$assay <- c(rep("clinical",20),sample(c("gene", "protein"), ncol(measurements)-20, replace = TRUE)) |
|
573 |
-#' mcols(measurements)$feature <- colnames(measurements) |
|
574 |
-#' modellingParams <- generateModellingParams(assayIDs = c("clinical", "gene", "protein"), |
|
575 |
-#' measurements = measurements, |
|
576 |
-#' nFeatures = list(clinical = 10, gene = 10, protein = 10), |
|
577 |
-#' selectionMethod = list(clinical = "t-test", gene = "t-test", protein = "t-test"), |
|
578 |
-#' selectionOptimisation = "none", |
|
579 |
-#' classifier = "randomForest", |
|
580 |
-#' multiViewMethod = "merge") |
|
581 |
-#' @import BiocParallel |
|
582 | 547 |
generateModellingParams <- function(assayIDs, |
583 | 548 |
measurements, |
584 | 549 |
nFeatures, |
585 | 550 |
deleted file mode 100644 |
... | ... |
@@ -1,26 +0,0 @@ |
1 |
-% Generated by roxygen2: do not edit by hand |
|
2 |
-% Please edit documentation in R/crossValidate.R |
|
3 |
-\name{generateCrossValParams} |
|
4 |
-\alias{generateCrossValParams} |
|
5 |
-\title{A function to generate a CrossValParams object} |
|
6 |
-\usage{ |
|
7 |
-generateCrossValParams(nRepeats, nFolds, nCores, selectionOptimisation) |
|
8 |
-} |
|
9 |
-\arguments{ |
|
10 |
-\item{nRepeats}{A numeric specifying the the number of repeats or permutations to use for cross-validation.} |
|
11 |
- |
|
12 |
-\item{nFolds}{A numeric specifying the number of folds to use for cross-validation.} |
|
13 |
- |
|
14 |
-\item{nCores}{A numeric specifying the number of cores used if the user wants to use parallelisation.} |
|
15 |
- |
|
16 |
-\item{selectionOptimisation}{A character of "Resubstitution", "Nested CV" or "none" specifying the approach used to optimise \code{nFeatures}.} |
|
17 |
-} |
|
18 |
-\value{ |
|
19 |
-CrossValParams object |
|
20 |
-} |
|
21 |
-\description{ |
|
22 |
-A function to generate a CrossValParams object |
|
23 |
-} |
|
24 |
-\examples{ |
|
25 |
-CVparams <- generateCrossValParams(nRepeats = 20, nFolds = 5, nCores = 8, selectionOptimisation = "none") |
|
26 |
-} |
27 | 0 |
deleted file mode 100644 |
... | ... |
@@ -1,63 +0,0 @@ |
1 |
-% Generated by roxygen2: do not edit by hand |
|
2 |
-% Please edit documentation in R/crossValidate.R |
|
3 |
-\name{generateModellingParams} |
|
4 |
-\alias{generateModellingParams} |
|
5 |
-\title{A function to generate a ModellingParams object} |
|
6 |
-\usage{ |
|
7 |
-generateModellingParams( |
|
8 |
- assayIDs, |
|
9 |
- measurements, |
|
10 |
- nFeatures, |
|
11 |
- selectionMethod, |
|
12 |
- selectionOptimisation, |
|
13 |
- performanceType = "auto", |
|
14 |
- classifier, |
|
15 |
- multiViewMethod = "none" |
|
16 |
-) |
|
17 |
-} |
|
18 |
-\arguments{ |
|
19 |
-\item{assayIDs}{A vector of data set identifiers as long at the number of data sets.} |
|
20 |
- |
|
21 |
-\item{measurements}{Either a \code{\link{DataFrame}}, \code{\link{data.frame}}, \code{\link{matrix}}, \code{\link{MultiAssayExperiment}} |
|
22 |
-or a list of these objects containing the data.} |
|
23 |
- |
|
24 |
-\item{nFeatures}{The number of features to be used for classification. If this is a single number, the same number of features will be used for all comparisons |
|
25 |
-or assays. If a numeric vector these will be optimised over using \code{selectionOptimisation}. If a named vector with the same names of multiple assays, |
|
26 |
-a different number of features will be used for each assay. If a named list of vectors, the respective number of features will be optimised over. |
|
27 |
-Set to NULL or "all" if all features should be used.} |
|
28 |
- |
|
29 |
-\item{selectionMethod}{Default: "auto". A character vector of feature selection methods to compare. If a named character vector with names corresponding to different assays, |
|
30 |
-and performing multiview classification, the respective classification methods will be used on each assay. If \code{"auto"} t-test (two categories) / F-test (three or more categories) ranking |
|
31 |
-and top \code{nFeatures} optimisation is done. Otherwise, the ranking method is per-feature Cox proportional hazards p-value.} |
|
32 |
- |
|
33 |
-\item{selectionOptimisation}{A character of "Resubstitution", "Nested CV" or "none" specifying the approach used to optimise \code{nFeatures}.} |
|
34 |
- |
|
35 |
-\item{performanceType}{Performance metric to optimise if classifier has any tuning parameters.} |
|
36 |
- |
|
37 |
-\item{classifier}{Default: \code{"auto"}. A character vector of classification methods to compare. If a named character vector with names corresponding to different assays, |
|
38 |
-and performing multiview classification, the respective classification methods will be used on each assay. If \code{"auto"}, then a random forest is used for a classification |
|
39 |
-task or Cox proportional hazards model for a survival task.} |
|
40 |
- |
|
41 |
-\item{multiViewMethod}{A character vector specifying the multiview method or data integration approach to use.} |
|
42 |
-} |
|
43 |
-\value{ |
|
44 |
-ModellingParams object |
|
45 |
-} |
|
46 |
-\description{ |
|
47 |
-A function to generate a ModellingParams object |
|
48 |
-} |
|
49 |
-\examples{ |
|
50 |
-data(asthma) |
|
51 |
-# First make a toy example assay with multiple data types. We'll randomly assign different features to be clinical, gene or protein. |
|
52 |
-set.seed(51773) |
|
53 |
-measurements <- DataFrame(measurements, check.names = FALSE) |
|
54 |
-mcols(measurements)$assay <- c(rep("clinical",20),sample(c("gene", "protein"), ncol(measurements)-20, replace = TRUE)) |
|
55 |
-mcols(measurements)$feature <- colnames(measurements) |
|
56 |
-modellingParams <- generateModellingParams(assayIDs = c("clinical", "gene", "protein"), |
|
57 |
- measurements = measurements, |
|
58 |
- nFeatures = list(clinical = 10, gene = 10, protein = 10), |
|
59 |
- selectionMethod = list(clinical = "t-test", gene = "t-test", protein = "t-test"), |
|
60 |
- selectionOptimisation = "none", |
|
61 |
- classifier = "randomForest", |
|
62 |
- multiViewMethod = "merge") |
|
63 |
-} |