# Load data
data(bipartite)
x <- bipartite$x
z <- bipartite$z
# Set seed
set.seed(123)
# Run CBL
cbl(x, z)
# With user-supplied feature selection subroutine
s_new <- function(x, y) {
# Fit model, extract coefficients
df <- data.frame(x, y)
f_full <- lm(y ~ 0 + ., data = df)
f_reduced <- step(f_full, trace = 0)
keep <- names(coef(f_reduced))
# Return bit vector
out <- ifelse(colnames(x) %in% keep, 1, 0)
return(out)
}
# \donttest{
cbl(x, z, s = s_new)
# }
Run the code above in your browser using DataLab