Skip to content

Commit

Permalink
Deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
rezaarezvan committed Sep 16, 2024
1 parent 43ee035 commit 7e21329
Show file tree
Hide file tree
Showing 93 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions cityu/cs4487/cs4487_2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ <h4 id="geometric-interpretation">Geometric Interpretation</h4>
\begin{align*}
f_{NB}(\mathbf{x}) &#x26;= \underset{c \in \{1, 2\}}{\arg\max} p(y = c) \prod_{j = 1}^{2} p(x_j | y = c) \newline
&#x26;= \underset{c \in \{1, 2\}}{\arg\max} \log p(y = c) + \sum_{j = 1}^{2} \log p(x_j | y = c) \newline
&#x26;= \underset{c \in \{1, 2\}}{\arg\max} \log p(y = c) + \sum_{j = 1}^{2} \log \mathcal{N}(x_j; \mu_{j | c}, \sigma_{j | c}^2) \newline
&#x26;= \underset{c \in \{1, 2\}}{\arg\max} \log p(y = c) + \sum_{j = 1}^{2} \log \left[ \frac{1}{\sqrt{2\pi\sigma_{j | c}^2}} \exp\left(-\frac{(x_j - \mu_{j | c})^2}{2\sigma_{j | c}^2}\right) \right] \newline
&#x26;= \underset{c \in \{1, 2\}}{\arg\max} \log p(y = c) + \sum_{j = 1}^{2} \log \left[\left(2\pi\sigma_{j | c}^2\right)^{-\frac{1}{2}} \exp\left(-\frac{(x_j - \mu_{j | c})^2}{2\sigma_{j | c}^2}\right) \right] \newline
&#x26;= \underset{c \in \{1, 2\}}{\arg\max} \log p(y = c) + \sum_{j = 1}^{2} \left( -\frac{1}{2} \log(2\pi\sigma_{j | c}^2) - \frac{(x_j - \mu_{j | c})^2}{2\sigma_{j | c}^2} \right)
\end{align*}
$$</p>
Expand All @@ -278,13 +281,13 @@ <h3 id="naive-bayes-for-boolean-vectors">Naive Bayes for Boolean Vectors</h3>
$$
p(x_j = 0 | y = c) = 1 - \varphi_{j | c}
$$</p>
<p>Therefore, the MLE parameters are $\varphi{j | c} = M_{j | c} / M_c$, where,
<p>Therefore, the MLE parameters are $\varphi_{j | c} = M_{j | c} / M_c$, where,
$M_{j | c}$ is the number of training examples in class $c$ that contain feature $x_j$.
$M_c$ is the number of training examples in class $c$.</p>
<p>We therefore get class-conditional distributions,
$$
p(x_1, \ldots, x_N | y = c) = \prod_{j = 1}^{N} p(x_j | y = c) = \prod_{j = 1}^{N} p(x_j | y = c) \newline
\log p(x_1, \ldots, x_N | y = c) = \sum_{j = 1}^{N} \log p(x_j | y = c) = \sum_{j = 1}^{N} \log p(x_j | y = c)
p(x_1, \ldots, x_N | y = c) = \prod_{j = 1}^{N} p(x_j | y = c) \newline
\log p(x_1, \ldots, x_N | y = c) = \sum_{j = 1}^{N} \log p(x_j | y = c)
$$</p>
<p>So, for an input example $\mathbf{x}$, the log-probabilities of features present given $y = c$ adds.</p>
<h4 id="smoothing">Smoothing</h4>
Expand All @@ -305,7 +308,7 @@ <h3 id="multinomial-naive-bayes">Multinomial Naive Bayes</h3>
<p>Then we need to use a multinomial (or categorical) distribution as class-conditional,
$$
p(x_j = k | y = c) = \varphi_{x, j | c} \newline
\sum_{x in \chi_j} \varphi_{x, j | c} = 1
\sum_{x \in \chi_j} \varphi_{x, j | c} = 1
$$</p>
<p>Our MLE parameter, $\varphi_{x, j | c} = M_{x, j | c} / M_{j | c}$, where,
$M_{x, j | c}$ is the number of training examples in class $c$ that have feature $x_j = x$.
Expand Down Expand Up @@ -346,7 +349,7 @@ <h4 id="geometric-interpretation-1">Geometric Interpretation</h4>
$$</p>
<p>By cancelling out the common terms, we get,
$$
\log \frac{p(y = 1)}{p(y = 2)} - \frac{1}{2} \mathbf{mu}_1^T \mathbf{\Sigma}^{-1} \mathbf{\mu}_1 + \frac{1}{2} \mathbf{mu}_2^T \mathbf{\Sigma}^{-1} \mathbf{\mu}_2 + (\mathbf{\mu}_1 - \mathbf{\mu}_2)^T \mathbf{\Sigma}^{-1} \mathbf{x} = 0
\log \frac{p(y = 1)}{p(y = 2)} - \frac{1}{2} \mathbf{\mu}_1^T \mathbf{\Sigma}^{-1} \mathbf{\mu}_1 + \frac{1}{2} \mathbf{\mu}_2^T \mathbf{\Sigma}^{-1} \mathbf{\mu}_2 + (\mathbf{\mu}_1 - \mathbf{\mu}_2)^T \mathbf{\Sigma}^{-1} \mathbf{x} = 0
$$</p>
<p>This shows that the decision boundary is linear in $\mathbf{x}$.</p>
<h3 id="naive-bayes-vs-lda">Naive Bayes vs LDA</h3>
Expand Down
Binary file removed pagefind/fragment/en_11184d7.pf_fragment
Binary file not shown.
Binary file not shown.
Binary file removed pagefind/fragment/en_12c1195.pf_fragment
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added pagefind/fragment/en_31fd63d.pf_fragment
Binary file not shown.
Binary file removed pagefind/fragment/en_36ea4c4.pf_fragment
Binary file not shown.
Binary file removed pagefind/fragment/en_3abcabf.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en_438850e.pf_fragment
Binary file not shown.
Binary file removed pagefind/fragment/en_46534ee.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en_4abc6b3.pf_fragment
Binary file not shown.
Binary file removed pagefind/fragment/en_4fa97c3.pf_fragment
Binary file not shown.
Binary file not shown.
Binary file added pagefind/fragment/en_546d78b.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en_5bf15ea.pf_fragment
Binary file not shown.
Binary file removed pagefind/fragment/en_60dd164.pf_fragment
Binary file not shown.
Binary file removed pagefind/fragment/en_61f45d2.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en_63fa9ba.pf_fragment
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added pagefind/fragment/en_66522f7.pf_fragment
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added pagefind/fragment/en_77da589.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en_7c7d7a7.pf_fragment
Binary file not shown.
Binary file removed pagefind/fragment/en_7f1a78b.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en_81b32f2.pf_fragment
Binary file not shown.
Binary file removed pagefind/fragment/en_8363a51.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en_85a71b7.pf_fragment
Binary file not shown.
Binary file removed pagefind/fragment/en_86fc40f.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en_8d4abe6.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en_8d58d8c.pf_fragment
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed pagefind/fragment/en_924925f.pf_fragment
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added pagefind/fragment/en_a78d67d.pf_fragment
Binary file not shown.
Binary file removed pagefind/fragment/en_ae82633.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en_afc1e72.pf_fragment
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed pagefind/fragment/en_b4a8531.pf_fragment
Binary file not shown.
Binary file removed pagefind/fragment/en_b5456d4.pf_fragment
Binary file not shown.
Binary file not shown.
Binary file removed pagefind/fragment/en_b932973.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en_c0a8a01.pf_fragment
Binary file not shown.
Binary file removed pagefind/fragment/en_c16b536.pf_fragment
Binary file not shown.
Binary file not shown.
Binary file removed pagefind/fragment/en_c6c7c79.pf_fragment
Binary file not shown.
Binary file not shown.
Binary file removed pagefind/fragment/en_d79f631.pf_fragment
Binary file not shown.
Binary file removed pagefind/fragment/en_d925f52.pf_fragment
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed pagefind/fragment/en_e2e7ef6.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en_e7fa689.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en_e964d2a.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en_ecd2c56.pf_fragment
Binary file not shown.
Binary file not shown.
Binary file added pagefind/fragment/en_fb6162d.pf_fragment
Binary file not shown.
Binary file added pagefind/fragment/en_fb9d8e9.pf_fragment
Binary file not shown.
Binary file added pagefind/index/en_11cb454.pf_index
Binary file not shown.
Binary file added pagefind/index/en_195f9c1.pf_index
Binary file not shown.
Binary file removed pagefind/index/en_1b619d3.pf_index
Binary file not shown.
Binary file added pagefind/index/en_2ff7c1d.pf_index
Binary file not shown.
Binary file added pagefind/index/en_4f7a4a3.pf_index
Binary file not shown.
Binary file added pagefind/index/en_59a69f2.pf_index
Binary file not shown.
Binary file removed pagefind/index/en_6390325.pf_index
Binary file not shown.
Binary file removed pagefind/index/en_6d6fedb.pf_index
Binary file not shown.
Binary file removed pagefind/index/en_804a542.pf_index
Binary file not shown.
Binary file added pagefind/index/en_a3c2ebd.pf_index
Binary file not shown.
Binary file added pagefind/index/en_b0f94cd.pf_index
Binary file not shown.
Binary file removed pagefind/index/en_c0ca24a.pf_index
Binary file not shown.
Binary file removed pagefind/index/en_c3511b2.pf_index
Binary file not shown.
Binary file added pagefind/index/en_c8d1884.pf_index
Binary file not shown.
Binary file removed pagefind/index/en_c9a1f78.pf_index
Binary file not shown.
Binary file added pagefind/index/en_d95354a.pf_index
Binary file not shown.
Binary file removed pagefind/index/en_e7114ad.pf_index
Binary file not shown.
Binary file added pagefind/index/en_f0a1606.pf_index
Binary file not shown.
Binary file removed pagefind/index/en_f1d1784.pf_index
Binary file not shown.
Binary file removed pagefind/index/en_f2a4e31.pf_index
Binary file not shown.
Binary file added pagefind/index/en_f834eba.pf_index
Binary file not shown.
Binary file removed pagefind/index/en_f9bb980.pf_index
Binary file not shown.
2 changes: 1 addition & 1 deletion pagefind/pagefind-entry.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"1.1.1","languages":{"en":{"hash":"en_70812422c9","wasm":"en","page_count":147}}}
{"version":"1.1.1","languages":{"en":{"hash":"en_a057c762d2","wasm":"en","page_count":147}}}
Binary file removed pagefind/pagefind.en_70812422c9.pf_meta
Binary file not shown.
Binary file added pagefind/pagefind.en_a057c762d2.pf_meta
Binary file not shown.
2 changes: 1 addition & 1 deletion posts/bucketlist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
</button> </nav> </div> </div> </header> <main> <div class="mx-auto max-w-screen-sm px-3"> <div class="animate"> <a href="/posts" class="not-prose group relative flex w-fit flex-nowrap rounded border border-black/15 py-1.5 pl-7 pr-3 transition-colors duration-300 ease-in-out hover:bg-black/5 hover:text-black focus-visible:bg-black/5 focus-visible:text-black dark:border-white/20 dark:hover:bg-white/5 dark:hover:text-white dark:focus-visible:bg-white/5 dark:focus-visible:text-white"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="absolute left-2 top-1/2 size-4 -translate-y-1/2 fill-none stroke-current stroke-2"> <line x1="5" y1="12" x2="19" y2="12" class="translate-x-2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:translate-x-0 group-hover:scale-x-100 group-focus-visible:translate-x-0 group-focus-visible:scale-x-100"></line> <polyline points="12 5 5 12 12 19" class="translate-x-1 transition-transform duration-300 ease-in-out group-hover:translate-x-0 group-focus-visible:translate-x-0"></polyline> </svg> <div class="text-sm"> Back to posts </div> </a> </div> <div class="my-10 space-y-1"> <div class="animate flex items-center gap-1.5"> <div class="font-base text-sm"> <time datetime="2022-07-31T15:21:34.000Z"> July 31, 2022 </time> </div>
&bull;
<div class="font-base text-sm">
Last modified: <time datetime="2024-07-13T21:29:20.000Z"> July 14, 2024 </time> </div>
Last modified: <time datetime="2024-09-14T11:18:10.000Z"> September 14, 2024 </time> </div>
&bull;
<div class="font-base text-sm"> 2 min read </div> </div> <h1 class="animate text-3xl font-semibold text-black dark:text-white"> My personal bucket list </h1> </div> <article class="animate"> <p>One day each and one of us will die - this is a universal truth. I am writing this to keep my self accountable and remind my future self to recognize where I was and where I’ve gotten to.</p>
<ul>
Expand Down

0 comments on commit 7e21329

Please sign in to comment.