This scorer returns the *weighted sum* score(s). See the **Details** section below for further information.
Usage
weightedSumScorer(
x,
i = NULL,
w = NULL,
na.rm = TRUE,
transform.fun = NULL,
transform.args = list(),
transform.sub = F
)
Arguments
- x
a numerical matrix features-by-samples
- i
(optional) numerical vector giving the (row) position in
x
or character vector matching the (row) names inx
. Ifmissing
ori = NULL
, the entirex
is considered for the computation of the score- w
numerical vector of weights. Its length must match the number of rows in
x
- na.rm
logical, whether to remove
NA
values fromx
before computation- transform.fun
function to transform the data. If provided,
x
is transformed (x = transform.fun(x, transform.args)
) before the computation of the scores. SeegetDataTransformer
for further details about built-in options- transform.args
list of parameters to the data transformation function
- transform.sub
logical, whether to transform
x
after it is subset fori
(used to speedup computation). Default isFALSE
, meaning the transformation would be applied directly tox
provided in input
Value
A numerical value representing the computed score.
A default NA
value is returned if the score can't be
computed, or if i
values are not present in x
.
Details
This function applies colSums2
to each column of the matrix resulting from w * x
.