trainModel,RGAModel-method {PDATK} | R Documentation

## Train a RGAModel Based on the Data in the assays slot.

### Description

Uses the switchBox SWAP.Train.KTSP function to fit a number of k top scoring pair models to the data, filtering the results to the best models based on the specified paramters.

### Usage

    ## S4 method for signature 'RGAModel'
    trainModel(object, numModels = 10, minAccuracy = 0, ...)

### Arguments

`object` | A `RGAmodel` object to train.
`numModels` | An `integer` specifying the number of models to train. Defaults to 10. We recommend using 1000+ for good results.
`minAccuracy` | A `float` specifying the balanced accuracy required to consider a model 'top scoring'. Defaults to 0. Must be in the range 0 to 1.
`...` | Fall through arguments to `BiocParallel::bplapply`.

### Details

This function is parallelized with BiocParallel, thus if you wish to change the back-end for parallelization, number of threads, or any other parallelization configuration please pass BPPARAM to bplapply.

### Value

A `RGAModel` object with the trained model in the `model` slot.

### See Also

`switchBox::SWAP.KTSP.Train` `BiocParallel::bplapply`

### Examples

    data(sampleRGAmodel)
    set.seed(getModelSeed(sampleRGAmodel))

    # Set parallelization settings
    BiocParallel::register(BiocParallel::SerialParam())

    trainedRGAmodel <- trainModel(sampleRGAmodel, numModels=2, minAccuracy=0)

[Package PDATK version 1.2.0 Index]