Skip to content

Sum for Poisson Equation #498

@alexmanne

Description

@alexmanne

Description:

This equation indicates that we should iterate through every word in vocab (which we define as every unique word in the training set). First off, this is unclear, and it is incorrect. Following this direction leads to incorrect probabilities that we are supposed to match in Problem 5.

Suggested Fix:

I found that if you iterate through each unique word in each message, this does return the correct probabilities. In addition, it aligns with the statement in the problem to use a default value if you encounter a word that is not in the training set.

Volume & Lab (By Name)

Volume 3: NaiveBayes

Source Lines

Relevant segments in `/Volume3/NaiveBayes/NaiveBayes.md`:
- Approximate line: 274:
  - Section: Training the Model:
    - TeX: $\argmax_{k\in K}\ln\left(P(C=k)\right) + 
\sum_{i\in\text{Vocab}}
\ln\left(\frac{(r_{i,k}n)^{n_i}e^{-r_{i,k}n}}{n_i!}\right),$ (`\argmax_{k\in K}\ln\left(P(C=k)\right) + 
\sum_{i\in\text{Vocab}}
\ln\left(\frac{(r_{i,k}n)^{n_i}e^{-r_{i,k}n}}{n_i!}\right),`)

Metadata

Metadata

Assignees

No one assigned

    Labels

    TypoMeaning is clear (to someone who's on the team), but there is a spelling/symbolic error

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions