linear_operator_from_groups(num_variables,
groups,
weights=None,
penalty_start=0)
| source code
|
Generates the linear operator for the group lasso Nesterov function
from the groups of variables.
Parameters:
----------
num_variables : Integer. The total number of variables, including the
intercept variable(s).
groups : A list of lists. The outer list represents the groups and the
inner lists represent the variables in the groups. E.g. [[1, 2],
[2, 3]] contains two groups ([1, 2] and [2, 3]) with variable 1 and
2 in the first group and variables 2 and 3 in the second group.
weights : List. Weights put on the groups. Default is weight 1 for each
group.
penalty_start : Non-negative integer. The number of variables to exempt
from penalisation. Equivalently, the first index to be penalised.
Default is 0, all variables are included.
|