Skip to content

Commit b915b0d

Browse files
committed
Revert "add group key + convert generator to list"
This reverts commit e4caae8.
1 parent bf6bc4a commit b915b0d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

chebai/preprocessing/datasets/tox21.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def download(self) -> None:
6868
def setup_processed(self) -> None:
6969
"""Processes and splits the dataset."""
7070
print("Create splits")
71-
data = list(self._load_data_from_file(os.path.join(self.raw_dir, f"tox21.csv")))
71+
data = self._load_data_from_file(os.path.join(self.raw_dir, f"tox21.csv"))
7272
groups = np.array([d["group"] for d in data])
7373
if not all(g is None for g in groups):
7474
split_size = int(len(set(groups)) * self.train_split)
@@ -145,10 +145,7 @@ def _load_data_from_file(self, input_file_path: str) -> List[Dict]:
145145
labels = [
146146
bool(int(l)) if l else None for l in (row[k] for k in self.HEADERS)
147147
]
148-
group = row.get("group", None)
149-
yield dict(
150-
features=smiles, labels=labels, ident=row["mol_id"], group=group
151-
)
148+
yield dict(features=smiles, labels=labels, ident=row["mol_id"])
152149

153150

154151
class Tox21Challenge(XYBaseDataModule):

0 commit comments

Comments
 (0)