Skip to content

Commit ba96980

Browse files
committed
set processed data props for pubchem
1 parent 94e14aa commit ba96980

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

chebai/preprocessing/datasets/pubchem.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,23 @@ def processed_file_names(self) -> List[str]:
183183
"""
184184
return ["test.pt", "train.pt", "validation.pt"]
185185

186+
def _set_processed_data_props(self):
187+
"""
188+
Load processed data and extract metadata.
189+
190+
Sets:
191+
- self._num_of_labels: Number of target labels in the dataset.
192+
- self._feature_vector_size: 0.
193+
"""
194+
with open(self.processed_dir_main, "classes.txt") as f:
195+
classes = [f.strip() for f in f.readlines() if f.strip()]
196+
197+
self._num_of_labels = len(classes)
198+
self._feature_vector_size = 0
199+
200+
print(f"Number of labels for loaded data: {self._num_of_labels}")
201+
print(f"Feature vector size: {self._feature_vector_size}")
202+
186203
def _perform_data_preparation(self, *args, **kwargs):
187204
"""
188205
Checks for raw data and downloads if necessary.

0 commit comments

Comments
 (0)