Skip to contents

This function adds significant interactions to a given trajectory model if they do not already exist. It identifies significant interactions based on the provided threshold and updates the model features with logistic features derived from these interactions. The trajectory model is then re-learned with the new features.

Usage

add_interactions(
  traj_model,
  interaction_threshold = 0.001,
  max_motif_n = NULL,
  max_add_n = NULL,
  lambda = 0.00001,
  alpha = 1,
  seed = 60427
)

Arguments

interaction_threshold

threshold for the selecting features to create interactions. IQ learns a linear model on the features and selects the features with coefficients above this threshold. Default: 0.001

lambda

A user supplied lambda sequence. Typical usage is to have the program compute its own lambda sequence based on nlambda and lambda.min.ratio. Supplying a value of lambda overrides this. WARNING: use with care. Avoid supplying a single value for lambda (for predictions after CV use predict() instead). Supply instead a decreasing sequence of lambda values. glmnet relies on its warms starts for speed, and its often faster to fit a whole path than compute a single fit.

alpha

The elasticnet mixing parameter, with \(0\le\alpha\le 1\). The penalty is defined as $$(1-\alpha)/2||\beta||_2^2+\alpha||\beta||_1.$$ alpha=1 is the lasso penalty, and alpha=0 the ridge penalty.

seed

random seed for reproducibility.

Value

The updated trajectory model with added interactions.