Fix Term_Frequency#165
Merged
jbesomi merged 14 commits intoSep 22, 2020
Merged
Conversation
suport MultiIndex as function parameter returns MultiIndex, where Representation was returned * missing: correct test Co-authored-by: Henri Froese <hf2000510@gmail.com>
*missing: test adopting for new types Co-authored-by: Henri Froese <hf2000510@gmail.com>
Co-authored-by: Henri Froese <henri.froese@yahoo.com>
17 tasks
Collaborator
Author
|
now, this branch is based on the master branch again and is ready for review/merge 🥇 🌵 |
Owner
|
Looks good and it has been merged. What would be nice ( probably to be done in a separate PR) is to have more friendly and funny doctest text content (instead of "Aha", "Text", ...). One idea, for instance, is to use famous sentences said by movie Superheroes. Here are a few examples:
Opinions? |
Collaborator
|
Added an issue for that, see #189 |
|
Great idea, I have already started to use Hero related text examples in the Docs and Tutorials I am working on. |
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.
The
term_frequencyfunction is currently implemented incorrectly. Example:Old implementation of term frequency returns:
New version returns:
We can see that the old version simply did
countfor each document and then divided each count value by the total number of terms across all documents (the.sum()in the old code). That does not make sense forterm_frequency. The new version will also do count, but then divide the count values of each document by the number of terms in that document to produce the correct term frequencies. Of course, that's the same as L1-Normalizing every row, so that's how we implemented it 🚥 .Note: only so many lines changed as this builds upon the DocumentTermDF (see #156)