createWeights: Create weights for COBRA Predictions

View source: R/createWeights.R

createWeightsR Documentation

Create weights for COBRA Predictions

Description

The createWeights function is used to calculate weights for predictions.

Usage

createWeights(train, test, n_train, n_test, nlearners, eps, alpha)

Arguments

train

A matrix representing the training data. Rows represent observations, and columns contain predictions from individual learners for these observations. In cases where a prediction is unavailable for a specific observation, NA is used.

test

A matrix representing the test data. Rows represent observations, and columns contain predictions from individual learners for these observations. In cases where a prediction is unavailable for a specific observation, NA is used.

n_train

An integer specifying the number of training observations.

n_test

An integer specifying the number of test observations.

nlearners

An integer representing the number of learners.

eps

A numeric value representing the threshold for proximity between two predictions.

alpha

A value that determines the optimal number of learners in the neighborhood (only for alpha optimization).


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