Skip to content

Commit d37542b

Browse files
knyazerPGijsbers
andauthored
Pass kwargs through task to get_dataset (#1345)
* Pass kwargs through task to ```get_dataset``` Allows to follow the directions in the warning ```Starting from Version 0.15 `download_data`, `download_qualities`, and `download_features_meta_data` will all be ``False`` instead of ``True`` by default to enable lazy loading.``` * docs: explain that ```task.get_dataset``` passes kwargs * Update openml/tasks/task.py Remove Py3.8+ feature for backwards compatibility --------- Co-authored-by: Pieter Gijsbers <[email protected]>
1 parent a3e57bb commit d37542b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

openml/tasks/task.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,12 @@ def _get_repr_body_fields(self) -> Sequence[tuple[str, str | int | list[str]]]:
145145
]
146146
return [(key, fields[key]) for key in order if key in fields]
147147

148-
def get_dataset(self) -> datasets.OpenMLDataset:
149-
"""Download dataset associated with task."""
150-
return datasets.get_dataset(self.dataset_id)
148+
def get_dataset(self, **kwargs) -> datasets.OpenMLDataset:
149+
"""Download dataset associated with task.
150+
151+
Accepts the same keyword arguments as the `openml.datasets.get_dataset`.
152+
"""
153+
return datasets.get_dataset(self.dataset_id, **kwargs)
151154

152155
def get_train_test_split_indices(
153156
self,

0 commit comments

Comments
 (0)