Skip to content

Commit

Permalink
Merge pull request #168 from slds-lmu/ex-svm-fix
Browse files Browse the repository at this point in the history
update ex_svm_1 and sol_svm_1
  • Loading branch information
sandylaker authored Dec 8, 2023
2 parents d24d1d1 + 2d43f9e commit f41d325
Show file tree
Hide file tree
Showing 15 changed files with 4 additions and 3 deletions.
Binary file modified exercises-pdf/ex_svm_1.pdf
Binary file not shown.
Binary file modified exercises-pdf/ex_svm_2.pdf
Binary file not shown.
Binary file modified exercises-pdf/ic_sol_svm_1.pdf
Binary file not shown.
Binary file modified exercises-pdf/ic_sol_svm_2.pdf
Binary file not shown.
Binary file modified exercises-pdf/ic_svm_1.pdf
Binary file not shown.
Binary file modified exercises-pdf/ic_svm_2.pdf
Binary file not shown.
Binary file modified exercises-pdf/sol_svm_1.pdf
Binary file not shown.
Binary file modified exercises-pdf/sol_svm_2.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion exercises/svm/ex_rnw/ex_linsvm_softmargin.Rnw
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ points(x1, x2, pch = ifelse(y == -1, "-", "+"), cex = 1.5)
Add the decision boundary to the figure for $\hat\theta = (1, 1)^T, \hat\theta_0 = -2$. (NB: This is the approximate optimum for $C=10$)

\item
Identify the coordinates of the support vector(s) and compute the values of their slack variables $\sli$.
Identify the coordinates of the points on the margin hyperplanes and compute the values of their slack variables $\sli$.

\item
Compute the Euclidean distance of the non-margin-violating support vector(s) (i.e. support vectors that are located on the margin hyperplanes) to the decision boundary.
Expand Down
5 changes: 3 additions & 2 deletions exercises/svm/ex_rnw/sol_linsvm_softmargin.Rnw
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

\item

To determine which points are support vectors, we will use the constraint:
To determine which points are on the margin hyperplanes, we will use the constraint:

\begin{equation}
y^{(i)} \left( x^{(i)} \thetah + \thetah_0 \right) \geq 1 - \sli
Expand All @@ -54,7 +54,7 @@
\end{cases}
\end{equation}

$(0.5, 0.5), (0, 1), (0, 3), (3, 0)$ are support vectors with slack value of $\sli = 0$ as they lie on the margin hyperplanes. $(0, 0)$ is also a support vector with slack value of $\sli = 3$.
$(0.5, 0.5), (0, 1), (0, 3), (3, 0)$ lie on the margin hyperplanes $\sli = 0$.

<<echo=FALSE, fig.align='center', fig.height=3, fig.width=3>>=
mpoints = list(c(0, 0),c(0.5, 0.5),c(0, 1), c(0,3), c(3,0), c(3,3))
Expand Down Expand Up @@ -100,6 +100,7 @@

\item

Note that $(0, 0)$ is a support vector with slack value of $\sli = 3$.
Some alternatives are:

\begin{itemize}
Expand Down
Binary file modified exercises/svm/figure/unnamed-chunk-3-1.pdf
Binary file not shown.
Binary file modified exercises/svm/figure/unnamed-chunk-4-1.pdf
Binary file not shown.
Binary file modified exercises/svm/figure/unnamed-chunk-5-1.pdf
Binary file not shown.
Binary file modified exercises/svm/figure/unnamed-chunk-7-1.pdf
Binary file not shown.
Binary file modified exercises/svm/figure/unnamed-chunk-8-1.pdf
Binary file not shown.

0 comments on commit f41d325

Please sign in to comment.