Skip to content

FIX - changed broken endpoint for reuters dataset #31186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

gdacciaro
Copy link
Contributor

This PR fixes bug #31185.

Problem

Theplot_out_of_core_classification.pyexample was failing with a StopIteration error when calling vectorizer.transform(X_test_text). This problem occurred both by running the script directly and during the documentation build (make html).

As reported in bug #31185, the traceback indicated that the raw_X iterator within HashingVectorizer was empty, causing the StopIteration error at the next(raw_X) call.

Root Cause

The error was caused by the fact that the URL used to download the dataset Reuters-21578, needed for the example, was broken or no longer valid. As a result, the dataset was not being downloaded properly, leading to empty test data (X_test_text).

Solution

This PR updates the constant DOWNLOAD_URL in the code related to fetching the Reuters dataset to point to the working URL hosted on the UCI Machine Learning repository.

Copy link

github-actions bot commented Apr 12, 2025

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 77666a6. Link to the linter CI: here

Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @gdacciaro

@jeremiedbb jeremiedbb merged commit 0df9676 into scikit-learn:main Apr 12, 2025
36 checks passed
@gdacciaro gdacciaro deleted the fix/changed-broken-endpoint-reuters-download branch April 13, 2025 13:52
lucyleeow pushed a commit to EmilyXinyi/scikit-learn that referenced this pull request Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants