createCobraPred: Create COBRA Predictions

createCobraPredR Documentation

Create COBRA Predictions

Description

The createCobraPred function calculates predictions by averaging the target values of all the nearest candidates in the training dataset. Only the training points that are within the specified proximity (eps) to the test point are used to determine the prediction. If no suitable training points are found, the function returns NA as the prediction.

Usage

createCobraPred(
  train,
  test,
  n_train,
  n_test,
  nlearners,
  eps,
  alpha,
  train_target
)

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).

train_target

A vector containing the target values for the training dataset


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