spect_train {spect}R Documentation

Generates a trained caret model using the given primary binary classification. Optionally generates a stacked ensemble model if a list of base learners is supplied.

Description

Generates a trained caret model using the given primary binary classification. Optionally generates a stacked ensemble model if a list of base learners is supplied.

Usage

spect_train(
  test_prop = 0.2,
  censor_type = "half",
  bin_slices = 10,
  method = "repeatedcv",
  resampling_number = 10,
  kfold_repeats = 3,
  model_algorithm,
  base_learner_list = list(),
  metric = "Kappa",
  rng_seed = 42,
  use_parallel = TRUE,
  cores = 0,
  modeling_data,
  event_indicator_var,
  survival_time_var,
  obs_window
)

Arguments

test_prop

optional proportion of the data set to reserve for testing

censor_type

optional method used to determine censorship in a given bin - may be "half", "prev" or "same". see createDiscreteDat for usage.

bin_slices

optional number of intervals to use for predictions.

method

optional caret parameter

resampling_number

optional for repeated cv

kfold_repeats

optional number of folds

model_algorithm

primary classification algorithm. Trains a stack-ensemble model if 'base_learner_list' is supplied, otherwise trains a simple classifier model.

base_learner_list

optional list of base learner algorithms

metric

optional metric for model calibration

rng_seed

optional random number generation seed for reproducibility

use_parallel

optioanlly make use of the caret multicore training cluster

cores

optioanl number of cores for multicore training. If zero, spect will attempt to make a good choice. Note: only relevant if 'use_parallel' is set to TRUE, otherwise this parameter is ignored.

modeling_data

This data set must have one column for time and one column for the event indicator. The remaining columns are treated as covariates for modeling.

event_indicator_var

The name of the column containing the event indicator (values in this column must be zero or one).

survival_time_var

The name of the column containing the time variable

obs_window

The last time to use for generating person-period data. Any event occurring after this time will be administratively censored. In general, choosing a time at or near the end of the max observed time will include most events.

Value

A list containing all intermediate data sets created by 'spect_train', a trained caret model object, the following parameters passed to 'spect_train': 'obs_window', 'survival_time_var', 'event_indicator_var', 'base_learner_list', 'bin_slices', and the bounds of each interval generated by the training data set.

Author(s)

Stephen Abrams, stephen.abrams@louisville.edu


[Package spect version 1.0 Index]