Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
24632d4
NLP Word Frequency Algorithms
danmurphy1217 Jun 21, 2020
cbb5f41
Added type hints and Wikipedia link to tf-idf
danmurphy1217 Jun 22, 2020
eb260b0
Update machine_learning/word_frequency_functions.py
danmurphy1217 Jun 22, 2020
e961f52
Update machine_learning/word_frequency_functions.py
danmurphy1217 Jun 22, 2020
e6b2357
Update machine_learning/word_frequency_functions.py
danmurphy1217 Jun 22, 2020
aa61ec8
Update machine_learning/word_frequency_functions.py
danmurphy1217 Jun 22, 2020
bed579d
Fix line length for flake8
danmurphy1217 Jun 22, 2020
616087b
Fix line length for flake8
danmurphy1217 Jun 22, 2020
9ef8e62
Fix line length for flake8 V2
danmurphy1217 Jun 22, 2020
1152edd
Add line escapes and change int to float
danmurphy1217 Jun 22, 2020
e8890d6
Corrected doctests
danmurphy1217 Jun 23, 2020
bcbb8f6
Fix for TravisCI
danmurphy1217 Jun 23, 2020
a2628d4
Fix for TravisCI V2
danmurphy1217 Jun 23, 2020
a0bef59
Tests passing locally
danmurphy1217 Jun 23, 2020
4cd803a
Tests passing locally
danmurphy1217 Jun 23, 2020
fcc07c9
Update machine_learning/word_frequency_functions.py
danmurphy1217 Jun 24, 2020
d35b5a6
Update machine_learning/word_frequency_functions.py
danmurphy1217 Jun 24, 2020
e901e09
Update machine_learning/word_frequency_functions.py
danmurphy1217 Jun 24, 2020
0a85c0f
Update machine_learning/word_frequency_functions.py
danmurphy1217 Jun 24, 2020
fcef21e
Add doctest examples and clean up docstrings
danmurphy1217 Jun 24, 2020
a0892e5
Merge branch 'dan' of https://github.com/danmurphy1217/Python into dan
danmurphy1217 Jun 24, 2020
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tests passing locally
  • Loading branch information
danmurphy1217 committed Jun 23, 2020
commit 4cd803ae586e22fab762cf822d3dfdb40922a101
6 changes: 3 additions & 3 deletions machine_learning/word_frequency_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def document_frequency(term: str, corpus: str) -> int:
@returns : the number of documents in the corpus that contain the term you are
searching for and the number of documents in the corpus
@examples :
>>> document_frequency("first", "This is the first document in the corpus.\\nThIs is\
the second document in the corpus.\\nTHIS is \
>>> document_frequency("first", "This is the first document in the corpus.\\nThIs\
is the second document in the corpus.\\nTHIS is \
the third document in the corpus.")
(1, 3)
"""
Expand Down Expand Up @@ -120,7 +120,7 @@ def tf_idf(tf : int, idf: int) -> float:
frequency : tf-idf = TF * IDF
@params : tf, the term frequency, and idf, the inverse document
frequency
@examples :
@examples :
>>> tf_idf(2, 0.477)
0.954
"""
Expand Down