Add interactions to a trajectory model
add_interactions.Rd
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 ownlambda
sequence based onnlambda
andlambda.min.ratio
. Supplying a value oflambda
overrides this. WARNING: use with care. Avoid supplying a single value forlambda
(for predictions after CV usepredict()
instead). Supply instead a decreasing sequence oflambda
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, andalpha=0
the ridge penalty.- seed
random seed for reproducibility.