You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow forcing a download even if cached files are already present #1132
Sometimes cache has to be updated, and manually removing the cache directory to force a download is required. It would be nice to simply force a cache refresh from code.
In the meanwhile, you can use this function (you can use the same arguments as get_dataset).
importopenmldefforce_get_dataset(dataset_id=None, *args, **kwargs):
""" Remove any existing local files about `dataset_id` and then download new copies. """did_cache_dir=openml.utils._create_cache_directory_for_id(openml.datasets.functions.DATASETS_CACHE_DIR_NAME, dataset_id, )
openml.utils._remove_cache_dir_for_id(openml.datasets.functions.DATASETS_CACHE_DIR_NAME, did_cache_dir)
returnopenml.datasets.get_dataset(dataset_id, *args, **kwargs)
if__name__=="__main__":
force_get_dataset(61)
Activity
PGijsbers commentedon Mar 28, 2022
In the meanwhile, you can use this function (you can use the same arguments as
get_dataset).LennartPurucker commentedon Jun 16, 2023
This was resolved by PR #1260 by adding an option to refresh the cache to
get_dataset.