From 54d19a43a1a3bed4189de0873a0401908544217e Mon Sep 17 00:00:00 2001 From: Rebecca Date: Thu, 7 Oct 2021 09:40:40 -0500 Subject: [PATCH] Change feature array initialization dtype to uint32 Modifying feature array initialization dtype from float64 to uint32 should reduce overall memory usage in initialization. --- kmodes/util/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmodes/util/__init__.py b/kmodes/util/__init__.py index 92f6b8e..ae31179 100644 --- a/kmodes/util/__init__.py +++ b/kmodes/util/__init__.py @@ -39,7 +39,7 @@ def encode_features(X, enc_map=None): else: fit = False - Xenc = np.zeros(X.shape).astype('int') + Xenc = np.zeros(X.shape, dtype='uint32') for ii in range(X.shape[1]): if fit: col_enc = {val: jj for jj, val in enumerate(np.unique(X[:, ii]))