Last active
August 27, 2018 13:16
-
-
Save bee-san/9630279836fa9994fd971f8f417e641f to your computer and use it in GitHub Desktop.
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
| function TFIDF(documents){ | |
| // calculates TF*IDF | |
| const TFVals = termFrequency(documents); | |
| const IDFVals = inverseDocumentFrequency(documents); | |
| let TFidfDict = {}; | |
| for (const [key, value] of Object.entries(TFVals)){ | |
| if (key in IDFVals){ | |
| TFidfDict[key] = TFVals[key] * IDFVals[key]; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment