Skip to content

Commit

Permalink
Fix incorrect signed noise terms for DiscreteAdditiveNoiseModel
Browse files Browse the repository at this point in the history
Signed-off-by: Gregory Saldanha <[email protected]>
  • Loading branch information
GregVS authored and bloebp committed Oct 22, 2024
1 parent 4bf7d30 commit b17f2c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dowhy/gcm/causal_mechanisms.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def fit(self, X: np.ndarray, Y: np.ndarray) -> None:
Y = Y.astype(np.int32)

self._prediction_model.fit(X=X, Y=Y)
self._noise_model.fit(self._rounded_prediction(X) - Y)
self._noise_model.fit(Y - self._rounded_prediction(X))

def evaluate(self, parent_samples: np.ndarray, noise_samples: np.ndarray) -> np.ndarray:
if not is_discrete(noise_samples):
Expand Down

0 comments on commit b17f2c3

Please sign in to comment.