Skip to content

Commit

Permalink
fix: handle residuals array is empty
Browse files Browse the repository at this point in the history
Signed-off-by: Endre Moen <[email protected]>
  • Loading branch information
emoen committed Jan 3, 2025
1 parent 8c72b52 commit 2ecc5d3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions causallearn/search/ScoreBased/ExactSearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ def bic_score_node(X, i, structure):
b=X[:, i],
rcond=None)
bic = n * np.log(residual / n) + len(structure) * np.log(n)
if bic.size == 0:
return NEGINF # Return negative infinity if bic is empty
return bic.item()


Expand Down

0 comments on commit 2ecc5d3

Please sign in to comment.