Last data update: 2014.03.03

R: Evaluate Performance of Kernel Parameters by Cross-validation
evaluateParametersR Documentation

Evaluate Performance of Kernel Parameters by Cross-validation

Description

For a given data set, chromosome, class, and kernel function, this function helps in determining optimal settings for the kernel parameter(s). The performance of individual parameter setting is assessed by cross- validation.

Usage

evaluateParameters(data, class, chromosome, kernel, kernelparams = NULL,
                   paramMultipliers = 2^(-4:4), subset = NULL, 
                   newlabels = NULL, ncross = 10, verbose = TRUE)

Arguments

data

Gene expression data in the MACAT list format. See data(stjude) for an example.

class

Sample class to be analyzed

chromosome

Chromosome to be analyzed

kernel

Choose kernel to smooth scores along the chromosome. Available are 'kNN' for k-Nearest-Neighbors, 'rbf' for radial-basis-function (Gaussian), 'basePairDistance' for a kernel, which averages over all genes within a given range of base pairs around a position.

kernelparams

Additional parameters for the kernel as list, e.g., kernelparams=list(k=5) for taking the 5 nearest neighbours in the kNN-kernel. If NULL some defaults are set within the function.

paramMultipliers

Numeric vector. If you do cross-validation of the kernel parameters, specify these as multipliers of the given (standard) kernel parameter, depending on your kernel choice (see page 5 of the vignette). The multiplication results are the kernel argument settings, among which you want to search for the optimal one using cross-validation.

subset

If a subset of samples is to be used, give vector of column- indices of these samples in the original matrix here.

newlabels

If other labels than the ones in the MACAT-list-structure are to be used, give them as character vector/factor here. Make sure argument 'class' is one of them.

ncross

Integer. Specify how many folds in cross-validation.

verbose

Logical. Should progress be reported to STDOUT?

Value

A list of class 'MACATevP' with 4 components:

[parameterName]

List of assessed settings for the parameter [parameterName].

avgResid

Average Residual Sum of Squares for the parameter settings in the same order as the first component.

multiplier

Multiplier of the original parameters in the same order as the first components.

best

List of parameter settings considered optimal by cross- validation. Can be directly inserted under the argument 'kernelparams' of the 'evalScoring' function.

Author(s)

MACAT development team

See Also

evalScoring

Examples

data(stjd)
evalkNN6 <- evaluateParameters(stjd, class="T", chromosome=6,kernel=kNN, 
                               paramMultipliers=c(0.01,seq(0.2,2.0,0.2),2.5))
if (interactive()&&capabilities("X11"))
  plot(evalkNN6)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(macat)
Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: annotate
Loading required package: AnnotationDbi
Loading required package: stats4
Loading required package: IRanges
Loading required package: S4Vectors

Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: XML
Loading MicroArray Chromosome Analysis Tool...
Loading required packages...

Type 'demo(macatdemo)' for a quick tour...

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/macat/evaluateParameters.Rd_%03d_medium.png", width=480, height=480)
> ### Name: evaluateParameters
> ### Title: Evaluate Performance of Kernel Parameters by Cross-validation
> ### Aliases: evaluateParameters plot.MACATevP
> ### Keywords: manip
> 
> ### ** Examples
> 
> data(stjd)
> evalkNN6 <- evaluateParameters(stjd, class="T", chromosome=6,kernel=kNN, 
+                                paramMultipliers=c(0.01,seq(0.2,2.0,0.2),2.5))
Compute observed test statistics...
Compute quantiles of empirical distributions...Done.

Evaluating parameter k = 1 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...

Evaluating parameter k = 7 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...

Evaluating parameter k = 14 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...

Evaluating parameter k = 21 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...

Evaluating parameter k = 28 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...

Evaluating parameter k = 34 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...

Evaluating parameter k = 41 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...

Evaluating parameter k = 48 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...

Evaluating parameter k = 55 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...

Evaluating parameter k = 62 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...

Evaluating parameter k = 68 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...

Evaluating parameter k = 85 ...
Iteration 1 ...Computing residuals for test scores...
Iteration 2 ...Computing residuals for test scores...
Iteration 3 ...Computing residuals for test scores...
Iteration 4 ...Computing residuals for test scores...
Iteration 5 ...Computing residuals for test scores...
Iteration 6 ...Computing residuals for test scores...
Iteration 7 ...Computing residuals for test scores...
Iteration 8 ...Computing residuals for test scores...
Iteration 9 ...Computing residuals for test scores...
Iteration 10 ...Computing residuals for test scores...
> #if (interactive()&&capabilities("X11"))
>   plot(evalkNN6)
NULL
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>