Convert Preprocess subdirectory to polars; drop keras_preprocessing; add pytest#175
Open
seanv507 wants to merge 7 commits into
Open
Convert Preprocess subdirectory to polars; drop keras_preprocessing; add pytest#175seanv507 wants to merge 7 commits into
seanv507 wants to merge 7 commits into
Conversation
…_preprocessing (implement pad_sequences)
Member
|
Thanks for the PR! I'v resolved the LF/CRLF issues. But the PR cannot be merged due to transform issues I mentioned in #172 (comment) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have converted pandas functions to polars in the preprocess subdirectory
Keras preprocessing is a deprecated library that only supports numpy <2.
The only function used is
pad_sequencesso I rewrote it in tokenizer.py using polars methods and removed the dependency.I added pytest library to make some unit tests.
I noticed that line endings are not consistent (and at least in local git saw ^M in my line changes) between CRLF and LF
(#173)
I checked the preprocessed output of Criteo and KKBox. I see almost no differences
https://huggingface.co/datasets/seanv507/KKBox_x1_pre/tree/d93eea9 (orig pandas version)
https://huggingface.co/datasets/seanv507/KKBox_x1_pre/tree/5de1e9c (polars version)
the difference is only in that (#174) ordering is not the same amongst categories of the same frequency (ie would need to order by frequency and then alphabetical)
From memory, tokenizing the Criteo data set took 15 minutes with pandas code vs 1 minute with Polars (on 64GB machine)