Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion universal/algos/anticor.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ def weights(self, X):
claim[i, j] += abs(M[j, j])

# calculate transfer
claim = np.nan_to_num(claim) #correlation can be nan
transfer = claim * 0.0
for i in range(m):
total_claim = sum(claim[i, :])
if total_claim != 0:
if total_claim != 0 and not np.isnan(total_claim).any(): #transfer should never be nan
transfer[i, :] = weights[t, i] * claim[i, :] / total_claim

# update weights
Expand Down