Skip to content

Commit

Permalink
Change feature array initialization dtype to uint32
Browse files Browse the repository at this point in the history
Modifying feature array initialization dtype from float64 to uint32 should reduce overall memory usage in initialization.
  • Loading branch information
rggelles committed Oct 7, 2021
1 parent a20f6ed commit 54d19a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kmodes/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand Down

0 comments on commit 54d19a4

Please sign in to comment.