DOC Fix Wikipedia principal eigenvector example - #34266
Conversation
Co-authored-by: Olivier Grisel <[email protected]>
virchan
left a comment
There was a problem hiding this comment.
LGTM! Thanks, @ArturoAmorQ!
@ogrisel, could we merge this?
|
I guess @ogrisel already has a lot on his plate, maybe we can just look for someone else's review? |
|
Out of interest, @ArturoAmorQ how did you bump into the issue? Do you run each morning a random file from the scikit-learn example gallery 😜? Maybe you used a LLM to try to find examples to improve 🤖? I pushed a tiny tweak and since the example wasn't taking that much time locally (1min30s) I thought it could be run as part of the doc build so I renamed it to add |
…nto wiki_example
|
Not sure what happened with the CI linting issue hoping merging For completeness, the error was: |
I bumped into it when experimenting methodologies to rank the recommended examples in our gallery. My initial idea was that more connected examples are more relevant.
It's mostly the first download of the data that is slow. |
|
Looking at the CircleCI log, the example when downloading the dataset takes less than 3 minutes which isn't that bad: The problem is more the size of the downloaded files that takes 900MB: That would make the Circle cache at 2-3 times bigger for just a single example, making it slower to upload/download in CircleCI, so in the end I am not sure it's worth it. Also people that run all the examples (not that many but maybe some sprint contributors are instructed to do I'll wait for the CircleCI doc to finish, maybe push another commit to see the impact on CircleCI cache and decide whether we rename the example back to what it was i.e. without Footnotes
|
|
Funnily enough this reminded me of one of my old issue (super-low priority) #8849, where running the Wikipedia example as part of the CI was mentioned 😉. |
Co-authored-by: Arturo Amor <[email protected]>
|
Looking at the logs the cache doesn't take much time to save/restore in CircleCI (less than seconds), I propose we run it as part of the CI. The slight downside is that someone doing |
|
The plot looks fine I have enabled auto-merge: https://output.circle-artifacts.com/output/job/af5ae68e-991d-49b2-8002-be58315c07cf/artifacts/0/doc/auto_examples/applications/plot_wikipedia_principal_eigenvector.html#plot-results |
Co-authored-by: Olivier Grisel <[email protected]> Co-authored-by: Loïc Estève <[email protected]>
Co-authored-by: Olivier Grisel <[email protected]> Co-authored-by: Loïc Estève <[email protected]>
Co-authored-by: Olivier Grisel <[email protected]> Co-authored-by: Loïc Estève <[email protected]>
Co-authored-by: Olivier Grisel <[email protected]> Co-authored-by: Loïc Estève <[email protected]>
Co-authored-by: Olivier Grisel <[email protected]> Co-authored-by: Loïc Estève <[email protected]>
Co-authored-by: Olivier Grisel <[email protected]> Co-authored-by: Loïc Estève <[email protected]>
Co-authored-by: Olivier Grisel <[email protected]> Co-authored-by: Loïc Estève <[email protected]>
Reference Issues/PRs
None
What does this implement/fix? Explain your changes.
This example failed when I tried to run locally because the download writes straight to the target file, so an interrupted transfer leaves an empty (0 KB) file behind.
This PR adds a safe download (using
sklearn.datasets.fetch_file) and fixesscores * X→scores @ X, for sparse array multiplication.It also adds 2 plots: One for the convergence error and the other for the pages with the highest eigenvector centrality.
AI usage disclosure
I used AI assistance for:
Any other comments?
The issue was not noticed before as this example is not run by our CI.