Skip to content

fetch_kddcup99 cache written uncompressed due to legacy decompression workaround #33117

Closed

Description

@un1u3

The fetch_kddcup99 dataset loader currently forces joblib.dump(..., compress=0) when writing its local cache. This appears to be a historical workaround for an old decompression bug referenced in an inline comment, but the workaround is still present. As a result, the cache is stored uncompressed even though the dataset is very large, leading to unnecessary disk usage and extra IO.

Image

Impact

  • Significantly larger local cache footprint for the KDDCup99 dataset
  • Increased disk usage and slower cache read/write operations
  • Inconsistent with other dataset fetchers that use compressed joblib caches by default

Steps/Code to Reproduce

from sklearn.datasets import fetch_kddcup99

# Download and cache the dataset
fetch_kddcup99(download_if_missing=True)

# Inspect the cache directory (default):
# ~/scikit_learn_data/kddcup99_10-py3/
# Files: samples, targets
# Observe these files are uncompressed on disk.

Expected Results

Cache files should be written with compression (e.g., compress=3) to reduce disk usage and IO.

Actual Results

Cache files are always written uncompressed due to compress=0.

Activity

  1. added
    Needs Triage
    on Jan 20, 2026
  2. removed
    Needs Triage
    on Jan 21, 2026
  3. ogrisel commented on Jan 21, 2026

    @ogrisel
    Member

    I agree we should try to use compression if it works with all supported versions of joblib, but I don't understand how you got the exception in the screenshot.

  4. un1u3 commented on Jan 21, 2026

    @un1u3
    ContributorAuthor

    I agree we should try to use compression if it works with all supported versions of joblib, but I don't understand how you got the exception in the screenshot.

    The exception in the screenshot came from a corrupted local cache (zero‑byte samples file), which triggered an EOFError when joblib.load tried to unpickle it. I should not have included that errorr screenshot since it reflects a local, transient cache issue rather than the actual behavior under normal conditions. I’ will remove the screenshot if you want
    and ig the PR fixes the issue and is mergeable

  5. ogrisel commented on Jan 21, 2026

    @ogrisel
    Member

    Let's remove the screenshot with the traceback because it's confusing.

  6. ogrisel commented on Jan 21, 2026

    @ogrisel
    Member

    Also, for the future, it's more efficient and more accessible to copy and paste code as a text rather than screenshots.

    You can use markdown to preserve the formatting of code blocks or multi line tracebacks and use syntax highlighting:

    https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks

  7. un1u3 commented on Jan 21, 2026

    @un1u3
    ContributorAuthor

    Also, for the future, it's more efficient and more accessible to copy and paste code as a text rather than screenshots.

    You can use markdown to preserve the formatting of code blocks or multi line tracebacks and use syntax highlighting:

    https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks

    All set now
    I think everything is okay and mergable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions