Repository navigation
Re-enable compressed cache for fetch_kddcup99 - #33118
Conversation
…share URL has been returning 403 forbidden errors since Dec 27,2024. This commit updates the download url to use the MIT CSAIL mirror which is currently accessible, Fixes scikit-learn#33002
ogrisel
left a comment
There was a problem hiding this comment.
According to sklearn/_min_dependencies.py, the oldest supported version of joblib is 1.3.0 (and the current version is 1.5.3).
I installed this version locally, deleted ~/scikit_learn_data/kddcup99_10-py3 and then I tried to run:
SKLEARN_SKIP_NETWORK_TESTS=0 pytest -vl sklearn/datasets/tests/test_kddcup99.py
All tests pass.
So this confirms that we don't observe the old joblib compression bug anymore.
The resulting local folder is much smaller, as expected:
$ du -hs ~/scikit_learn_data/kddcup99_10-py3
18M /Users/ogrisel/scikit_learn_data/kddcup99_10-py3
It used to be on the order of 100 MB.
Could you please add a changelog entry for this fix? See: https://github.com/scikit-learn/scikit-learn/blob/main/doc/whats_new/upcoming_changes/README.md
|
@ogrisel |
|
Please fix the linter problem and add the changelog entry as detailed in my last comment. |
| @@ -0,0 +1,2 @@ | |||
| - Re-enabled compressed caching for :func:`datasets.fetch_kddcup99`, reducing | |||
| on-disk cache size without changing the public API. | |||
There was a problem hiding this comment.
Please credit yourself using the formatting described in the instructions:
There was a problem hiding this comment.
You could also rename this filename to 33118.efficiency.rst since this is a disk space optimization.
|
The coverage failure is normal. This part of the code is not necessarily triggered because we don't want to download data each time on all CI workers and maybe the ones that actually do are not collecting the coverage data. |
|
Let's wait for a second reviewer to have a look, otherwise I plan to merge in a short while. |
Fixes #33117
Re-enable compressed cache for `fetch_kddcup99
Why
The KDDCup99 cache is currently forced to be written uncompressed due to a legacy
decompression workaround. This significantly inflates disk usage for a very large
dataset. Re-enabling compression reduces storage requirements and disk I/O without
changing the public API or user-facing behavior.
What changed
samplesandtargetsusingjoblib.dump(..., compress=3)in_kddcup99.py.test_kddcup99.pythat builds a compressed cache andverifies that
fetch_kddcup99can load it correctly without network access.Review focus
compress=3) is a reasonabletrade-off between cache size reduction and CPU overhead.
does not require network access.
AI usage disclosure
This pull request includes code checks and PR enhancement using AI.