This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def compute_vif_intercept_ave(model, X, sr): | |
| """ | |
| Compute average VIF for each predictor group, supporting sparse, numpy, and torch.Tensor X. | |
| """ | |
| from sklearn.linear_model import LinearRegression | |
| import numpy as np | |
| import torch | |
| vifregr = LinearRegression(n_jobs=-1, fit_intercept=False) # Correct: no intercept for VIF | |
| delays_ = np.arange(int(np.round(model.tmin * sr)), int(np.round(model.tmax * sr) + 1)) |