Skip to content

Commit

Permalink
fixed group lasso w/ extra weights
Browse files Browse the repository at this point in the history
  • Loading branch information
fullbat committed Nov 20, 2024
1 parent a8365e7 commit 0002dd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions commit/core.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ cdef class Evaluation :
Aty = np.asarray(At.dot(y))
return np.max(np.abs(Aty[start:start+size]) / w_coeff)

def compute_lambda_max_group(w_group, idx_group):
def compute_lambda_max_group(w_group, idx_group):
# Ref. Yuan, Lin - 'Model selection and estimation in regression with grouped variables'
At = self.A.T
y = self.get_y()
Expand Down Expand Up @@ -997,7 +997,7 @@ cdef class Evaluation :
# In case of 'group_lasso' or 'sparse_group_lasso' update the group indices and compute group weights
if regularisation['regIC'] == 'group_lasso' or regularisation['regIC'] == 'sparse_group_lasso':
if 'group_weights_extra' in dictIC_params:
weightsIC_group = dictIC_params['group_weights_extra']
weightsIC_group = dictIC_params['group_weights_extra'].copy()
else:
weightsIC_group = np.ones(dictIC_params['group_idx'].size, dtype=np.float64)
# update the group indices considering only the kept elements
Expand Down

0 comments on commit 0002dd5

Please sign in to comment.