Skip to content

Commit

Permalink
Update train.py DataLoader (#25)
Browse files Browse the repository at this point in the history
Bug fix groupby action for categorical data to only show observed values in resulting DataFrame.
  • Loading branch information
meyerkm authored Sep 26, 2023
1 parent 284eb25 commit 7215b4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deeprvat/deeprvat/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def __getitem__(self, index):
start_idx = index * self.batch_size
end_idx = min(self.total_samples, start_idx + self.batch_size)
batch_samples = self.sample_order.iloc[start_idx:end_idx]
samples_by_pheno = batch_samples.groupby("phenotype")
samples_by_pheno = batch_samples.groupby("phenotype", observed=True)

result = dict()
for pheno, df in samples_by_pheno:
Expand Down

0 comments on commit 7215b4e

Please sign in to comment.