# Load the synthetic data
data(RegressionExample)
tree.org <- RegressionExample$tree.org # original tree structure
x2.org <- RegressionExample$x.org # original design matrix
y <- RegressionExample$y # response
# Do the tree-guided expansion
expand.data <- getetmat(tree.org, x2.org)
x2 <- expand.data$x.expand # expanded design matrix
tree.expand <- expand.data$tree.expand # expanded tree structure
# specify some model parameters
set.seed(100)
control <- list(maxit = 100, mu = 1e-3, tol = 1e-5, verbose = FALSE)
# fit model with a pair of lambda and alpha
modstr <- list(lambda = 1, alpha = 0.1)
x1 <- NULL
fit1 <- TSLA.fit(y, x1, x2, tree.expand, family = 'ls',
penalty = 'CL2',
gamma.init = NULL, weight = NULL,
group.weight = NULL, feature.weight = NULL,
control, modstr)
# get group norms from fit1
fit1$groupnorm
Run the code above in your browser using DataLab