# default: all pairwise interactions
lm(mpg ~ b_inter(cyl, hp, wt), mtcars)
# how number of features depends on interaction depth
for (d in 1:6) {
X = with(mtcars, b_inter(cyl, disp, hp, drat, wt, depth=d))
print(ncol(X))
}
Run the code above in your browser using DataLab