Skip to content

Commit 16d6db9

Browse files
authored
Merge pull request #248 from ZJsheep/fix_bdeu
Fix implementation of the structure prior term of the BDeu score
2 parents b4f064f + d486643 commit 16d6db9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

causallearn/score/LocalScoreFunction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def local_score_BDeu(Data: ndarray, i: int, PAi: List[int], parameters=None) ->
148148

149149
BDeu_score = 0
150150
# first term
151-
vm = Data.shape[0] - 1
151+
vm = Data.shape[1] - 1
152152
BDeu_score += len(PAi) * np.log(structure_prior / vm) + (vm - len(PAi)) * np.log(
153153
1 - (structure_prior / vm)
154154
)

0 commit comments

Comments
 (0)