Skip to content

Commit

Permalink
hotfix for new polars count (#107)
Browse files Browse the repository at this point in the history
Fixes #106
  • Loading branch information
egillax authored Dec 22, 2023
1 parent f3340d9 commit 6e4b523
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inst/python/Dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self, data, labels=None, numerical_features=None):

# numerical data,
# N x C, dense matrix with values for N patients/visits for C numerical features
if pl.count(self.numerical_features) == 0:
if self.numerical_features.count() == 0:
self.num = None
else:
map_numerical = dict(zip(self.numerical_features.sort().to_list(),
Expand All @@ -96,7 +96,7 @@ def __init__(self, data, labels=None, numerical_features=None):
self.num = torch.sparse_coo_tensor(
indices=indices.T,
values=values.squeeze(),
size=(observations, pl.count(self.numerical_features)),
size=(observations, self.numerical_features.count()),
).to_dense()
delta = time.time() - start
print(f"Processed data in {delta:.2f} seconds")
Expand Down

0 comments on commit 6e4b523

Please sign in to comment.