Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs13-23sp
project02
Commits
3f250bcd
Commit
3f250bcd
authored
1 year ago
by
Nicholas Stone Adamo
Browse files
Options
Download
Email Patches
Plain Diff
Better docs
parent
fe4dd598
master
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bayes.py
+3
-3
bayes.py
with
3 additions
and
3 deletions
+3
-3
bayes.py
View file @
3f250bcd
...
...
@@ -34,9 +34,9 @@ def train(dataset):
"""
TODO - Implement the following functions.
In each of these functions, you can use the MODEL variable which is a dictionary which has three members:
MODEL['count_of_word_by_outcome'][outcome][word] =
count_of_word_in_all_document
s
MODEL['num_data_points'] = number
_
of
_
documents
_
in
_
the
_
dataset
MODEL['count_of_data_points_with_outcome'][outcome] = number
_
of
_
documents
_
in
_
the
_data_set_which_have_the_correct_outcome_as_outcome
MODEL['count_of_word_by_outcome'][outcome][word] =
Total number of documents in the category 'outcome' in which this word appear
s
MODEL['num_data_points'] =
Total
number
of
documents
in
the
data
set
MODEL['count_of_data_points_with_outcome'][outcome] =
Total
number
of
documents
in
the
category 'outcome'
"""
@
cache
def
pr_outcome
(
outcome
:
str
)
:
# Pr(outcome)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help