estimateBestQ: Find the optimal encoding dimension

View source: R/method-estimateBestQ.R

estimateBestQR Documentation

Find the optimal encoding dimension

Description

Finds the optimal encoding dimension by either Optimal Hard Thresholding or injecting artificial splicing outlier ratios while maximizing the precision-recall curve.

Usage

estimateBestQ(
  ods = NULL,
  zScoresOHT = NULL,
  useOHT = TRUE,
  params = seq(2, min(100, ncol(ods) - 1, nrow(ods) - 1), 2),
  freq = 0.01,
  zScore = 3,
  sdlog = log(1.6),
  lnorm = TRUE,
  inj = "both",
  ...,
  BPPARAM = bpparam()
)

findInjectZscore(
  ods,
  freq = 0.01,
  zScoreParams = c(seq(1.5, 4, 0.5), "lnorm"),
  encDimParams = c(seq(3, 40, 3), seq(45, 70, 5), 100, 130, 160),
  inj = "both",
  ...,
  BPPARAM = bpparam()
)

Arguments

ods

An OutriderDataSet object

zScoresOHT

A z-score matrix

useOHT

If TRUE (default), Optimal Hard Thresholding is used to estimate the optimal encoding dimension.

params, encDimParams

Set of possible q values.

freq

Frequency of outlier, defaults to 1E-2

zScore, zScoreParams

Set of possible injection Z-score, defaults to 3.

sdlog

Standard deviation of the sitribution on the log scale.

lnorm

If TRUE, the default, Z-scores are drawn from a log normal distribution with a mean of log(zScore) in log-scale.

inj

Injection strategy, by default 'both'.

...

Further arguments passed on to the controlForConfounders function.

BPPARAM

BPPARAM object by default bpparam().

Value

The OutriderDataSet object with the optimal encoding dimension saved in the metadata

Examples

ods <- makeExampleOutriderDataSet()

# run OHT (default)
estimateBestQ(ods)

# run hyperparameter optimization (grid-search)
encDimSearchParams <- c(5, 8, 10, 12, 15)
zScoreParams <- c(2, 3, 5, 'lnorm')
implementation <- 'autoencoder'
register(MulticoreParam(4))

ods1 <- estimateBestQ(ods, useOHT=FALSE, params=encDimSearchParams, 
        implementation=implementation)
plotEncDimSearch(ods1)

ods2 <- findInjectZscore(ods, zScoreParams=zScoreParams,
        encDimParams=encDimSearchParams, implementation=implementation)
plotEncDimSearch(ods2) 


gagneurlab/OUTRIDER documentation built on June 13, 2025, 9:43 a.m.