weightedMeanLearner: The weighted mean meta-learner

weightedMeanLearnerR Documentation

The weighted mean meta-learner

Description

Modality-specific learner are assessed and weighted based on their predictions. This function is intended to be (internally) used as meta-learner in fuseMLR.

Usage

weightedMeanLearner(x, y, weighted = TRUE, perf = NULL, na_rm = FALSE)

Arguments

x

data.frame
Modality-specific predictions. Each column of the data.frame content the predictions a specific learner.

y

vector
True target values. If classification, either binary or two level factor variable.

weighted

boolean
If TRUE, a weighted sum is computed. As default, weights are estimated based on Brier Score for classification setting and mean squared error for regression. Otherwise, use argument perf below to specify the function to use estimate learner performance.

perf

function
Function to compute layer-specific performance of learners. If NULL, the Brier Score (classification) or a mean squared error (regression) is used by default as performance measure. Otherwise, the performance function must accept two parameters: observed (observed values) and predicted (predicted values).

na_rm

boolean
Should missing values be removed when computing the weights?

Value

Object of class weightedMeanLearner with the vector of estimated weights pro layer.

Examples

set.seed(20240624L)
x = data.frame(x1 = runif(n = 50L, min = 0, max = 1),
               x2 = runif(n = 50L, min = 0, max = 1))
y = sample(x = 0L:1L, size = 50L, replace = TRUE)
my_model = weightedMeanLearner(x = x, y = y)


fuseMLR documentation built on April 3, 2025, 8:49 p.m.