Fix: Use secure HTTPS and automatic extraction for MovieLens dataset#2241
Fix: Use secure HTTPS and automatic extraction for MovieLens dataset#2241jaytiwarihub wants to merge 8 commits intokeras-team:masterfrom
Conversation
Summary of ChangesHello @jaytiwarihub, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the data loading and preparation steps across several Keras examples. The primary goal is to improve the security of data acquisition by enforcing HTTPS for dataset downloads and to simplify the extraction process by utilizing Keras's built-in utilities or providing clear, programmatic extraction methods. These changes contribute to more secure, reliable, and user-friendly example code by automating common data setup tasks. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request improves dataset handling in several examples. For text_classification_from_scratch.py and collaborative_filtering_movielens.py, it correctly replaces manual download/extraction steps with keras.utils.get_file, and for the latter, it also laudably updates the URL to use secure HTTPS. These changes make the examples more robust and easier to run. However, the changes in examples/audio/speaker_recognition_using_cnn.py seem out of scope, as they introduce manual extraction logic rather than using keras.utils.get_file. I've provided some suggestions to improve code clarity and reduce redundancy in that file.
sachinprasadhs
left a comment
There was a problem hiding this comment.
Remove the newly added .ipynb file.
You only make changes to the .py file and the .ipynb and .md file can be generated through the script mentioned here https://github.com/keras-team/keras-io/blob/master/README.md#previewing-a-new-example
|
|
||
| # Download the actual data from http://files.grouplens.org/datasets/movielens/ml-latest-small.zip" | ||
| # Use the ratings.csv file | ||
| # FIX: Use HTTPS and let Keras handle extraction automatically |
There was a problem hiding this comment.
You can remove this comment.
|
This PR is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you. |
|
This PR is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you. |
Description
Updated the MovieLens dataset loader to use the secure
httpsprotocol (replacinghttp) and replaced manualzipfileextraction with the built-inkeras.utils.get_file(..., extract=True)utility.Changes
http://tohttps://for security.ZipFileextraction code.extract=Trueinget_fileto handle caching and extraction automatically.Test Plan
ml-latest-small.zipfile downloads and extracts correctly to~/.keras/datasets/.