From 517a9eb5870f832663a8c0f520866275780a8a0f Mon Sep 17 00:00:00 2001 From: Lukas Heumos Date: Sat, 4 May 2024 09:44:39 -0700 Subject: [PATCH] Use numpy tile instead of matrix (#1170) Signed-off-by: zethson --- dowhy/gcm/stats.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dowhy/gcm/stats.py b/dowhy/gcm/stats.py index 2d778bc108..2a074eb708 100644 --- a/dowhy/gcm/stats.py +++ b/dowhy/gcm/stats.py @@ -1,7 +1,6 @@ from typing import Callable, List, Optional, Union import numpy as np -from numpy.matlib import repmat from scipy import stats from sklearn.linear_model import LinearRegression @@ -146,7 +145,7 @@ def marginal_expectation( # baseline_noise_samples.shape[0] * feature_samples.shape[0]. Here, we reduce it to # batch_size * feature_samples.shape[0]. If the batch_size would be set 1, then each baseline_noise_samples is # evaluated one by one in a for-loop. - inputs = repmat(feature_samples, batch_size, 1) + inputs = np.tile(feature_samples, (batch_size, 1)) for offset in range(0, baseline_samples.shape[0], batch_size): # Each batch consist of at most batch_size * feature_samples.shape[0] many samples. If there are multiple # batches, the offset indicates the index of the current baseline_noise_samples that has not been evaluated yet.