likelihoodRatioSelection {ClassifyR} | R Documentation

## Selection of Differential Distributions with Likelihood Ratio Statistic

### Description

Ranks features by largest ratio and chooses the features which have the best resubstitution performance.

### Usage

      ## S4 method for signature 'matrix'
    likelihoodRatioSelection(measurements, classes, ...)
      ## S4 method for signature 'DataFrame'
    likelihoodRatioSelection(measurements, classes, datasetName,
                             trainParams, predictParams, resubstituteParams,
                                    alternative = c(location = "different", scale = "different"),
                                    ..., selectionName = "Likelihood Ratio Test (Normal)", verbose = 3)
      ## S4 method for signature 'MultiAssayExperiment'
    likelihoodRatioSelection(measurements, targets = names(measurements), ...)

### Arguments

`measurements` | Either a `matrix`, `DataFrame` or `MultiAssayExperiment` containing the training data. For a `matrix`, the rows are features, and the columns are samples.
`classes` | Either a vector of class labels of class `factor` of the same length as the number of samples in `measurements` or if the measurements are of class `DataFrame` a character vector of length 1 containing the column name in `measurement` is also permitted. Not used if `measurements` is a `MultiAssayExperiment` object.
`targets` | If `measurements` is a `MultiAssayExperiment`, the names of the data tables to be used. `"clinical"` is also a valid value and specifies that numeric variables from the clinical data table will be used.
`...` | Variables not used by the `matrix` nor the `MultiAssayExperiment` method which are passed into and used by the `DataFrame` method or options which are accepted by the function `getLocationsAndScales`.
`datasetName` | A name for the data set used. Stored in the result.
`trainParams` | A container of class `TrainParams` describing the classifier to use for training.
`predictParams` | A container of class `PredictParams` describing how prediction is to be done.
`resubstituteParams` | An object of class `ResubstituteParams` describing the performance measure to consider and the numbers of top features to try for resubstitution classification.
`alternative` | Default: `c("different", "different")`. A vector of length 2. The first element specifies the location of the alternate hypothesis. The second element specifies the scale of the alternate hypothesis. Valid values in each element are "same" or "different".
`selectionName` | A name to identify this selection method by. Stored in the result.
`verbose` | Default: 3. A number between 0 and 3 for the amount of progress messages to give. This function only prints progress messages if the value is 3.

### Details

Likelihood ratio test of null hypothesis that the location and scale are the same for both groups, and an alternate hypothesis that is specified by parameters. The location and scale of features is calculated by `getLocationsAndScales`. The distribution fitted to the data is the normal distribution.

Data tables which consist entirely of non-numeric data cannot be analysed. If `measurements` is an object of class `MultiAssayExperiment`, the factor of sample classes must be stored in the DataFrame accessible by the `colData` function with column name `"class"`.

### Value

An object of class `SelectResult` or a list of such objects, if the classifier which was used for determining the specified performance metric made a number of prediction varieties.

### Author(s)

Dario Strbenac

### Examples

      # First 20 features have bimodal distribution for Poor class.
      # Other 80 features have normal distribution for both classes.
      set.seed(1984)
      genesMatrix <- sapply(1:25, function(sample)
                                  {
                                    randomMeans <- sample(c(8, 12), 20, replace = TRUE)
                                    c(rnorm(20, randomMeans, 1), rnorm(80, 10, 1))
                                  }
                           )
      genesMatrix <- cbind(genesMatrix, sapply(1:25, function(sample) rnorm(100, 10, 1)))
      rownames(genesMatrix) <- paste("Gene", 1:nrow(genesMatrix))
      classes <- factor(rep(c("Poor", "Good"), each = 25))

      resubstituteParams <- ResubstituteParams(nFeatures = seq(10, 100, 10),
                                               performanceType = "balanced error",
                                               better = "lower")
      selected <- likelihoodRatioSelection(genesMatrix, classes, "Example",
                                           trainParams = TrainParams(naiveBayesKernel),
                               predictParams = PredictParams(NULL),
                               resubstituteParams = resubstituteParams)

      head(selected@chosenFeatures[[1]])

[Package ClassifyR version 2.4.4 Index]