Skip to content

Commit

Permalink
Merge pull request #211 from emoen/fix/exact_search_bic_is_float
Browse files Browse the repository at this point in the history
fix: handle residuals array is empty
  • Loading branch information
kunwuz authored Jan 3, 2025
2 parents 8c72b52 + 2ecc5d3 commit b07c316
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 b07c316

Please sign in to comment.