-
Notifications
You must be signed in to change notification settings - Fork 13
add classification notes #265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@copilot complete and polish the introduction to classification section |
|
@d-morrison I've opened a new pull request, #266, to work on those changes. Once the pull request is ready, I'll request review from you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new section on classification to the probability document, introducing concepts related to positive predictive value through a COVID-19 testing example. The changes include a new classification chapter file, a macro definition for probability mass functions, and an update to gitignore.
- Adds new
classification.qmdfile with positive predictive value calculations - Defines
\pmfmacro inmacros.qmdfor probability mass function notation - Updates
.gitignoreto exclude Quarto IPython notebook files
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 14 comments.
| File | Description |
|---|---|
| classification.qmd | New file containing classification introduction and positive predictive value example with Bayesian calculations |
| probability.qmd | Includes the new classification section in the probability document |
| macros.qmd | Adds \pmf macro definition for probability mass function notation |
| .gitignore | Adds pattern to ignore Quarto IPython notebook cache files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
classification.qmd
Outdated
| $$\mass(A) = 0.07$$ | ||
|
|
||
| $$\mass(\neg A) = .93$$ | ||
|
|
||
|
|
||
|
|
||
| $p\left( negative \middle| no\ covid \right) = .99$: | ||
| $p\left( B \middle| !A \right)$ | ||
|
|
||
| $$p\left( Covid \middle| positive \right) = ?$$ | ||
|
|
||
| $$p\left( A \middle| B \right) = \frac{p\left( B \middle| A \right)p(A)}{p(B)}$$ | ||
|
|
||
| $$p(B) = p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)$$ | ||
|
|
||
| $$p\left( B \middle| A \right)p(A) = .99*\ .07 = .0693$$ | ||
|
|
||
| $$\ p\left( B \middle| !A \right)p(!A) = .01*.93 = .0093$$ | ||
|
|
||
| $$p(B) = .0693 + .0093 = .0786$$ | ||
|
|
||
| $$p\left( A \middle| B \right) = .0693/.0786$$ | ||
|
|
||
| $$= .88$$ | ||
|
|
||
| $${p\left( A \middle| B \right) = \frac{p\left( B \middle| A \right)p(A)}{p(B)} | ||
| }{= p\left( B \middle| A \right)\frac{p(A)}{p(B)} | ||
| }{= p\left( B \middle| A \right)\frac{p(A)}{p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)}}$$ | ||
|
|
||
| $$= \frac{p(A)}{p(A) + \frac{p\left( B \middle| !A \right)}{p\left( B \middle| A \right)}p(!A)}$$ | ||
|
|
||
| $$= \frac{1}{1 + \frac{p\left( B \middle| !A \right)}{p\left( B \middle| A \right)}\frac{p(!A)}{p(A)}} |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent notation. Earlier in the document, disease is represented as D (line 12), but here it's represented as A. The notation should be consistent throughout the document.
| $$\mass(A) = 0.07$$ | |
| $$\mass(\neg A) = .93$$ | |
| $p\left( negative \middle| no\ covid \right) = .99$: | |
| $p\left( B \middle| !A \right)$ | |
| $$p\left( Covid \middle| positive \right) = ?$$ | |
| $$p\left( A \middle| B \right) = \frac{p\left( B \middle| A \right)p(A)}{p(B)}$$ | |
| $$p(B) = p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)$$ | |
| $$p\left( B \middle| A \right)p(A) = .99*\ .07 = .0693$$ | |
| $$\ p\left( B \middle| !A \right)p(!A) = .01*.93 = .0093$$ | |
| $$p(B) = .0693 + .0093 = .0786$$ | |
| $$p\left( A \middle| B \right) = .0693/.0786$$ | |
| $$= .88$$ | |
| $${p\left( A \middle| B \right) = \frac{p\left( B \middle| A \right)p(A)}{p(B)} | |
| }{= p\left( B \middle| A \right)\frac{p(A)}{p(B)} | |
| }{= p\left( B \middle| A \right)\frac{p(A)}{p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)}}$$ | |
| $$= \frac{p(A)}{p(A) + \frac{p\left( B \middle| !A \right)}{p\left( B \middle| A \right)}p(!A)}$$ | |
| $$= \frac{1}{1 + \frac{p\left( B \middle| !A \right)}{p\left( B \middle| A \right)}\frac{p(!A)}{p(A)}} | |
| $$\mass(D) = 0.07$$ | |
| $$\mass(\neg D) = .93$$ | |
| $p\left( negative \middle| no\ covid \right) = .99$: | |
| $p\left( B \middle| \neg D \right)$ | |
| $$p\left( Covid \middle| positive \right) = ?$$ | |
| $$p\left( D \middle| B \right) = \frac{p\left( B \middle| D \right)p(D)}{p(B)}$$ | |
| $$p(B) = p\left( B \middle| D \right)p(D) + p\left( B \middle| \neg D \right)p(\neg D)$$ | |
| $$p\left( B \middle| D \right)p(D) = .99*\ .07 = .0693$$ | |
| $$\ p\left( B \middle| \neg D \right)p(\neg D) = .01*.93 = .0093$$ | |
| $$p(B) = .0693 + .0093 = .0786$$ | |
| $$p\left( D \middle| B \right) = .0693/.0786$$ | |
| $$= .88$$ | |
| $${p\left( D \middle| B \right) = \frac{p\left( B \middle| D \right)p(D)}{p(B)} | |
| }{= p\left( B \middle| D \right)\frac{p(D)}{p(B)} | |
| }{= p\left( B \middle| D \right)\frac{p(D)}{p\left( B \middle| D \right)p(D) + p\left( B \middle| \neg D \right)p(\neg D)}}$$ | |
| $$= \frac{p(D)}{p(D) + \frac{p\left( B \middle| \neg D \right)}{p\left( B \middle| D \right)}p(\neg D)}$$ | |
| $$= \frac{1}{1 + \frac{p\left( B \middle| \neg D \right)}{p\left( B \middle| D \right)}\frac{p(\neg D)}{p(D)}} |
classification.qmd
Outdated
| $p\left( negative \middle| no\ covid \right) = .99$: | ||
| $p\left( B \middle| !A \right)$ | ||
|
|
||
| $$p\left( Covid \middle| positive \right) = ?$$ |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent notation. Line 25 uses no\ covid (with escaped space), line 26 uses !A, and line 28 uses Covid. The notation should be consistent - either use the symbolic notation consistently (like \neg A or !A) or use descriptive text consistently.
| $p\left( negative \middle| no\ covid \right) = .99$: | |
| $p\left( B \middle| !A \right)$ | |
| $$p\left( Covid \middle| positive \right) = ?$$ | |
| $p\left( B \middle| \neg A \right) = .99$: | |
| $p\left( B \middle| \neg A \right)$ | |
| $$p\left( A \middle| B \right) = ?$$ |
classification.qmd
Outdated
|
|
||
| $$p(B) = p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)$$ | ||
|
|
||
| $$p\left( B \middle| A \right)p(A) = .99*\ .07 = .0693$$ |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space before multiplication operator. Remove the space after the asterisk: should be .99 * .07 instead of .99*\ .07.
| $$p\left( B \middle| A \right)p(A) = .99*\ .07 = .0693$$ | |
| $$p\left( B \middle| A \right)p(A) = .99 * .07 = .0693$$ |
classification.qmd
Outdated
| $p\left( negative \middle| no\ covid \right) = .99$: | ||
| $p\left( B \middle| !A \right)$ | ||
|
|
||
| $$p\left( Covid \middle| positive \right) = ?$$ |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent disease reference. Line 17 mentions "covid" but line 28 switches to "Covid" (capitalized). The disease name should be consistently capitalized (typically "COVID-19" or just "disease" if keeping it generic).
classification.qmd
Outdated
| $$\mass(A) = 0.07$$ | ||
|
|
||
| $$\mass(\neg A) = .93$$ |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undefined notation \mass. This macro is used but not defined in macros.qmd, which could cause compilation errors. Consider using \pmf or defining the \mass macro.
classification.qmd
Outdated
|
|
||
| $$p\left( B \middle| A \right)p(A) = .99*\ .07 = .0693$$ | ||
|
|
||
| $$\ p\left( B \middle| !A \right)p(!A) = .01*.93 = .0093$$ |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leading space before equation. Remove the leading backslash-space: should be p\left( instead of \ p\left(.
| $$\ p\left( B \middle| !A \right)p(!A) = .01*.93 = .0093$$ | |
| $$p\left( B \middle| !A \right)p(!A) = .01*.93 = .0093$$ |
classification.qmd
Outdated
| $${p\left( A \middle| B \right) = \frac{p\left( B \middle| A \right)p(A)}{p(B)} | ||
| }{= p\left( B \middle| A \right)\frac{p(A)}{p(B)} | ||
| }{= p\left( B \middle| A \right)\frac{p(A)}{p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)}}$$ |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Malformed LaTeX equation. Lines 44-46 appear to be a single equation split incorrectly with multiple $$ delimiters. This should use proper multi-line equation formatting like \begin{align} or separate the steps into individual equations with text between them.
| $${p\left( A \middle| B \right) = \frac{p\left( B \middle| A \right)p(A)}{p(B)} | |
| }{= p\left( B \middle| A \right)\frac{p(A)}{p(B)} | |
| }{= p\left( B \middle| A \right)\frac{p(A)}{p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)}}$$ | |
| $$ | |
| \begin{align*} | |
| p\left( A \middle| B \right) &= \frac{p\left( B \middle| A \right)p(A)}{p(B)} \\ | |
| &= p\left( B \middle| A \right)\frac{p(A)}{p(B)} \\ | |
| &= p\left( B \middle| A \right)\frac{p(A)}{p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)} | |
| \end{align*} | |
| $$ |
classification.qmd
Outdated
| $$\pmf{ + | D} = .99$$ | ||
|
|
||
| 99% specific means if they don't have covid, the test says no covid, 99% | ||
| time | ||
|
|
||
| 7% of people actually have covid: | ||
|
|
||
| $$\mass(A) = 0.07$$ | ||
|
|
||
| $$\mass(\neg A) = .93$$ | ||
|
|
||
|
|
||
|
|
||
| $p\left( negative \middle| no\ covid \right) = .99$: | ||
| $p\left( B \middle| !A \right)$ | ||
|
|
||
| $$p\left( Covid \middle| positive \right) = ?$$ | ||
|
|
||
| $$p\left( A \middle| B \right) = \frac{p\left( B \middle| A \right)p(A)}{p(B)}$$ | ||
|
|
||
| $$p(B) = p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)$$ | ||
|
|
||
| $$p\left( B \middle| A \right)p(A) = .99*\ .07 = .0693$$ | ||
|
|
||
| $$\ p\left( B \middle| !A \right)p(!A) = .01*.93 = .0093$$ | ||
|
|
||
| $$p(B) = .0693 + .0093 = .0786$$ | ||
|
|
||
| $$p\left( A \middle| B \right) = .0693/.0786$$ | ||
|
|
||
| $$= .88$$ | ||
|
|
||
| $${p\left( A \middle| B \right) = \frac{p\left( B \middle| A \right)p(A)}{p(B)} | ||
| }{= p\left( B \middle| A \right)\frac{p(A)}{p(B)} | ||
| }{= p\left( B \middle| A \right)\frac{p(A)}{p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)}}$$ | ||
|
|
||
| $$= \frac{p(A)}{p(A) + \frac{p\left( B \middle| !A \right)}{p\left( B \middle| A \right)}p(!A)}$$ | ||
|
|
||
| $$= \frac{1}{1 + \frac{p\left( B \middle| !A \right)}{p\left( B \middle| A \right)}\frac{p(!A)}{p(A)}} |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Inconsistent decimal notation. Throughout the document, probabilities are written as .99, .07, .93, etc. (without leading zero), but it would be clearer and more standard to use 0.99, 0.07, 0.93 for readability.
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
…ated notation Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Create classification appendix chapter with polished content
No description provided.