Learn R Programming

viruslearner (version 0.0.2)

cd_stack: CD4 Cell Count or Viral Load Plot of Blending Coefficients for the Stacking Ensemble

Description

A plot of the contribution of each model obtained using ensemble learning through stacking of models and grid search for tuning hyperparameters of CD4 cell count or viral load outcomes.

Usage

cd_stack(outcome, traindata, viralvars, logbase, seed, repetitions, gridsize)

Value

A plot of a data stack with multiple model definitions and candidate members.

Arguments

outcome

The outcome variable name (CD4 cell count).

traindata

The training data set.

viralvars

Vector of viral load variables.

logbase

Logarithm base for viral load transformations.

seed

Seed for reproducibility.

repetitions

Number of repetitions for cross-validation.

gridsize

Size of the grid for hyperparameter tuning.

Examples

Run this code
# \donttest{
library(baguette)
library(kernlab)
library(kknn)
library(ranger)
library(rules)
data("cd_train", package = "viruslearner")
outcome <- "cd_2023"
traindata <- cd_train
viralvars <- c("vl_2019", "vl_2021", "vl_2022", "vl_2023")
logbase <- 10
seed <- 1501
repetitions <- 2
gridsize <- 1
cd_stack(outcome, traindata, viralvars, logbase, seed, repetitions, gridsize)
# }

Run the code above in your browser using DataLab