rescalePredictorWeights: Rescale the Predictor Weights

rescalePredictorWeights,Solver-methodR Documentation

Rescale the Predictor Weights

Description

Solvers such as LASSO penalize predictors on a scale of 1 (full weight) to infinity (zero weight). With the rescalePredictorWeights method, incoming raw values can be scaled between a possibly theoretical minimum and maximum value.

Usage

## S4 method for signature 'Solver'
rescalePredictorWeights(obj, rawValue.min, rawValue.max, rawValues)

Arguments

obj

An object of the Solver class

rawValue.min

The minimum value of the raw expression values

rawValue.max

The maximum value of the raw expression values

rawValues

A matrix of raw expression values

Value

A matrix of the raw values re-scaled using the minimum and maximum values

Examples

# Create a LassoSolver object using the included Alzheimer's data and rescale the predictors
load(system.file(package="trena", "extdata/ampAD.154genes.mef2cTFs.278samples.RData"))
targetGene <- "MEF2C"
candidateRegulators <- setdiff(rownames(mtx.sub), targetGene)
ls <- LassoSolver(mtx.sub, targetGene, candidateRegulators)
raw.values <- c(241, 4739, 9854, 22215, 658334)
cooked.values <- rescalePredictorWeights(ls, rawValue.min = 1, rawValue.max = 1000000, raw.values)

PriceLab/trena documentation built on March 16, 2023, 10:01 a.m.