diff --git a/dpbench/benchmarks/pca/pca_dpnp.py b/dpbench/benchmarks/pca/pca_dpnp.py index cbf51dd5..f163f6ea 100644 --- a/dpbench/benchmarks/pca/pca_dpnp.py +++ b/dpbench/benchmarks/pca/pca_dpnp.py @@ -10,7 +10,7 @@ def pca(data, dims_rescaled_data=2): data -= data.mean(axis=0) # calculate the covariance matrix - v = np.cov(data, rowvar=False) + v = np.cov(data, rowvar=False, dtype=data.dtype) # calculate eigenvectors & eigenvalues of the covariance matrix evalues, evectors = np.linalg.eigh(v) diff --git a/dpbench/benchmarks/pca/pca_numpy.py b/dpbench/benchmarks/pca/pca_numpy.py index 7c180a7a..6735216d 100644 --- a/dpbench/benchmarks/pca/pca_numpy.py +++ b/dpbench/benchmarks/pca/pca_numpy.py @@ -10,7 +10,7 @@ def pca(data, dims_rescaled_data=2): data -= data.mean(axis=0) # calculate the covariance matrix - v = np.cov(data, rowvar=False) + v = np.cov(data, rowvar=False, dtype=data.dtype) # calculate eigenvectors & eigenvalues of the covariance matrix evalues, evectors = np.linalg.eigh(v)