Skip to content

Commit

Permalink
Merge pull request #1021 from visserle/patch-1
Browse files Browse the repository at this point in the history
[Fix] Prevent `sparseda` method from raising `AttributeError`
  • Loading branch information
DominiqueMakowski authored Aug 16, 2024
2 parents b99036c + 124dc04 commit d783e40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions neurokit2/eda/eda_phasic.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ def lasso(R, s, sampling_rate, maxIters, epsilon):
)
ATv = np.matmul(R.transpose(), v).flatten()

gammaI = np.Inf
gammaI = np.inf
removeIndices = []

inactiveSet = np.arange(0, W)
Expand All @@ -603,7 +603,7 @@ def lasso(R, s, sampling_rate, maxIters, epsilon):
epsilon = 1e-12
gammaArr = (lmbda - c[inactiveSet]) / (1 - ATv[inactiveSet] + epsilon)

gammaArr[gammaArr < zeroTol] = np.Inf
gammaArr[gammaArr < zeroTol] = np.inf
gammaIc = np.min(gammaArr)
# Imin = np.argmin(gammaArr)
newIndices = inactiveSet[(np.abs(gammaArr - gammaIc) < zeroTol)]
Expand Down

0 comments on commit d783e40

Please sign in to comment.