Skip to content

Commit fb7269b

Browse files
Update BandedTRF examples
1 parent 6975f27 commit fb7269b

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

examples/banded_ridge_TRF_fitting/plot_banded_trf_comparison.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@
195195

196196
# --- Right Plot: Banded TRF (Independent Alpha) ---
197197
# In the banded approach, we look at the R-path for the specific feature band
198-
banded_path = banded_model.alpha_paths_[feat]
198+
banded_path = banded_model.alpha_paths_[b_idx]
199199
# Calculate marginal improvement relative to previous bands' max R
200-
prev_banded_r = 0 if b_idx == 0 else np.max(banded_model.alpha_paths_[feature_list[b_idx-1]])
200+
prev_banded_r = 0 if b_idx == 0 else np.max(banded_model.alpha_paths_[b_idx-1])
201201
banded_delta_path = banded_path - prev_banded_r
202202

203203
best_banded_alpha = banded_model.feature_alphas_[feat]

examples/banded_ridge_TRF_fitting/plot_banded_trf_optimization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@
102102
fig, axes = plt.subplots(1, 2, figsize=(12, 4), sharey=False)
103103
for i, (mdl, ord_list) in enumerate(zip([model1, model2], [order_1, order_2])):
104104
feat = ord_list[b_idx]
105-
path = mdl.alpha_paths_[feat]
105+
path = mdl.alpha_paths_[b_idx]
106106

107107
# Calculate Delta R Path relative to the max R of the previous band
108-
prev_r = 0 if b_idx == 0 else np.max(mdl.alpha_paths_[ord_list[b_idx-1]])
108+
prev_r = 0 if b_idx == 0 else np.max(mdl.alpha_paths_[b_idx-1])
109109
delta_path = path - prev_r
110110

111111
best_alpha = mdl.feature_alphas_[feat]

0 commit comments

Comments
 (0)