Skip to content

Commit e18711d

Browse files
committed
solving svms manually
1 parent f2f1c27 commit e18711d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
302 KB
Loading
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Disclaimer
2+
This is not in the study design, however, our teacher has done this in a previous SAC.
3+
## Question
4+
![[Pasted image 20250909182949.png]]
5+
## Process
6+
1. **Find the equation of an actual line that is a decent hyperplane:**
7+
Here, a good hyperplane would be a linear line in the middle of the points (2,3) and (4,5). Note that the gradient of the line would be $-1$ (perpendicular to the line that joins the two support vectors). Hence, note that our line would be: $x_{2}-3=-(x_{1}-2)$. Rearranging, we get $x_{1}+x_{2}-7=0$.
8+
2. **Note down the proportion of the weights and find a relationship between the weights:**
9+
The weights $(w_{1},w_{2})$ must be proportional to the coefficients of the line. Hence, $(w_{1},w_{2})=k(1,1),k\in \mathbb{R}$. Therefore, $w_{1}=w_{2}$.
10+
3. **Create new equations that satisfy the class +1 and -1 equations:**
11+
Recall that support vectors must satisfy the margin equations:
12+
- $w_{1}x_{1}+w_{2}x_{2}+b=+1$ - positive class vectors
13+
- $w_{1}x_{1}+w_{2}x_{2}+b=-1$ - negative class vectors
14+
Substituting points, this yields:
15+
- $4w_{1}+5w_{2}+b=-1$
16+
- $2w_{1}+3w_{2}+b=1$
17+
4. **Solve the equations for the weights and biases, by using the relation from step 2:**
18+
Solving yields $w_{1}=w_{2}=\frac{1}{2},b=-\frac{7}{2}$.

0 commit comments

Comments
 (0)