optimHyperParams: Find optimal encoding dimension

View source: R/find_encoding_dimensions.R

optimHyperParamsR Documentation

Find optimal encoding dimension

Description

Finds the optimal encoding dimension by injecting artificial splicing outlier ratios while maximizing the precision-recall curve.

Usage

optimHyperParams(
  fds,
  type = psiTypes,
  implementation = "PCA",
  q_param = getEncDimRange(fds),
  noise_param = 0,
  minDeltaPsi = 0.1,
  iterations = 5,
  setSubset = 50000,
  injectFreq = 0.01,
  BPPARAM = bpparam(),
  internalThreads = 1,
  plot = TRUE,
  delayed = ifelse(ncol(fds) <= 300, FALSE, TRUE),
  ...
)

Arguments

fds

A FraserDataSet object

type

The type of PSI (jaccard, psi5, psi3 or theta for theta/splicing efficiency)

implementation

The method that should be used to correct for confounders.

q_param

Vector specifying which values of q should be tested

noise_param

Vector specifying which noise levels should be tested.

minDeltaPsi

Minimal delta psi of an intron to be be considered a variable intron.

iterations

The maximal number of iterations. When the autoencoder has not yet converged after these number of iterations, the fit stops anyway.

setSubset

The size of the subset of the most variable introns that should be used for the hyperparameter optimization.

injectFreq

The frequency with which outliers are injected into the data.

BPPARAM

the BiocParallel parameters for the parallelization

internalThreads

The number of threads used internally.

plot

If TRUE, a plot of the area under the curve and the model loss for each evaluated parameter combination will be displayed after the hyperparameter optimization finishes.

delayed

If FALSE, count matrices will be loaded into memory (faster calculations), otherwise the function works on the delayedMatrix representations (more memory efficient). The default value depends on the number of samples in the fds-object.

...

Additional parameters passed to injectOutliers.

Value

FraserDataSet

See Also

FRASER

Examples

  # generate data
  fds <- makeSimulatedFraserDataSet(m=15, j=20)
  fds <- calculatePSIValues(fds)
  
  # run hyperparameter optimization
  fds <- optimHyperParams(fds, type="jaccard", q_param=c(2, 5))
  
  # get estimated optimal dimension of the latent space
  bestQ(fds, type="jaccard")
  hyperParams(fds, type="jaccard")
  

c-mertes/FraseR documentation built on June 15, 2024, 3:29 a.m.