Support Vector Machine (SVM)
- SVM stands for Support Vector Machine
- Definitions:
- SVM can handle non-linear data using Kernel in SVM
- Use Kernel Trick not to project the data all time to save computation
- Two types of SVM
- Hard SVM - No misclassification - Similar to Maximal Margin Classifier with Kernel
- Soft SVM - Allow misclassification - Similar to SVC with Kernel
Intuition of the math behind SVM
If two support vector from both side are x1 and x2 respectively, then we need to find a line which will maximize (x2 - x1). If the equation of the hyperplane is
Subtracting (i) from (ii), we get,
As we need to maximize
Equation of SVM
Equation of Soft SVM
Soft SVM is used to make the mode more robust and generalized. We allow to have some amount of errors so that the model doesn't overfit the train data.
where,
Basic Assumption of SVM
There is no basic assumption of SVM
Advantages of SVM
- SVM is more effective for higher dimensional data
- Can be used for unstructured data like text, images
- With proper kernel function, any problem can be solved
- With soft SVM very less chance of overfitting
- Very memory efficient, as we only need (W, b) during inference
Disadvantages of SVM
- Long training time
- It is difficult to choose a good kernel function
- Bad at Handling Outliers
- Bad at Handling Missing Data
- Bad at Handling Imbalanced Dataset