SVM
Gamma and Regularization
Software
• A list of SVM implementation can be found at
[Link]
• Some implementation (such as LIBSVM) can handle multi-class
classification
• SVMLight is among one of the earliest implementation of SVM
• Several Matlab toolboxes for SVM are also available
17
Summary: Steps for Classification
• Prepare the pattern matrix
• Select the kernel function to use
• Select the parameter of the kernel function and the value of C
• You can use the values suggested by the SVM software, or you can set apart a
validation set to determine the values of the parameter
• Execute the training algorithm and obtain the αi
• Unseen data can be classified using the αi and the support vectors
18
Strengths and Weaknesses of SVM
• Strengths
• Training is relatively easy
• No local optimal, unlike in neural networks
• It scales relatively well to high dimensional data
• Tradeoff between classifier complexity and error can be controlled explicitly
• Non-traditional data like strings and trees can be used as input to SVM,
instead of feature vectors
• Weaknesses
• Need to choose a “good” kernel function.
19
Conclusion
• SVM is a useful alternative to neural networks
• Two key concepts of SVM: maximize the margin and the kernel trick
• Many SVM implementations are available on the web for you to try
on your data set!
20
Q Train SVM classifier using sklearn digits
dataset (i.e. from [Link] import
load_digits) and then,
1. Measure accuracy of your model using different kernels such as
rbf and linear.
2. Tune your model further using regularization and gamma
parameters and try to come up with highest accurancy score
3. Use 80% of samples as training data size
Explain following: