This is actually correct code. Nothing is wrong with it per se.
However, NOTE: that this is meant for OVO (one versus one) SVM. Basically if you are comparing two classes. THIS is not meant for more than two classes, hence why you would get a lower accuracy.
Answer from user70145 on Stack ExchangeImplementing SVM from scratch? - Data Science Stack Exchange
Python - SVM kernel and algorithm from scratch - Stack Overflow
NEED HELP WITH SVM KERNEL CODE IN PYTHON FROM SCRATCH
Help regarding SVM KERNEL code without sci-kit learn
Videos
Hi everyone
Sorry if what I am asking is elementary but I am new to machine learning and I have been asked to build a SVM classifier with Gaussian or Polynomial Kernel which solves the Dual Quadratic Problem from scratch without importing it directly from any library like sci-kit learn.
I understand the math behind it but since I am new to coding I am unable to find a comprehensive YT video since everyone just imports it from sci-kit learn, I tried finding books but they were from a long time ago and didn't have python implementation, I tried GitHub code, but in two instances that I found it, it was all over the place.
Can anyone link me up to a simple code or let me know where to search, I will be extremely appreciative of you.