Support Vector Machines Explained
See margins, support vectors and kernels clearly, then tune C and gamma with confidence
A taste of a lesson
I raised C from 1 to 1000 and training accuracy went up but test accuracy fell. Why?
With C at 1000 the SVM is told that every margin violation is very expensive, so it bends the boundary, or narrows the margin, to classify almost every training point correctly, including noisy ones. That is classic overfitting: the boundary fits quirks of your training sample. A smaller C accepts a few mistakes in exchange for a wider, simpler margin that usually generalises better. If you use an RBF kernel, gamma interacts with this too. What gamma did you use, and did you scale your features?
Written by the teacher as an example. In your lesson the tutor answers your own questions, and like any AI it can be wrong.
What you will be able to do
- Explain the maximum margin idea and the role of support vectors
- Describe how C trades margin width against violations
- Explain the kernel trick and the effect of gamma in an RBF kernel
- Tune C and gamma together on a sensible scale
- Decide when an SVM suits a dataset's size and shape
Lesson plan
- 1 The widest street Picture the maximum margin hyperplane and identify support vectors. Start
- 2 Soft margins and C Handle overlapping classes and see what C controls. Start
- 3 Hinge loss Connect the SVM to a loss function and regularisation. Start
- 4 The kernel trick Understand how kernels create nonlinear boundaries efficiently. Start
- 5 Tuning C and gamma Search both settings together and read the results. Start
- 6 When to use an SVM Judge SVM fit for dataset size, dimensionality and output needs. Start
Try asking
About this tutor
An intermediate tutor for learners who know basic classification and want to understand support vector machines properly. You start with the geometry of a separating line and the widest margin, then add soft margins, the hinge loss and the kernel trick. Lessons connect each idea to the settings you actually tune, especially C and gamma, and explain scaling, probability outputs and how SVMs behave as datasets grow. Light linear algebra is used where it helps, always with a picture first. You finish able to reason about when an SVM is a good fit and when it is not.
Reviews
4.5
2 ratingsSample
- Nadia F.Sample
The 'widest street' picture made margins intuitive. The kernel lesson needed two passes but the tutor was patient.
- Pedro A.Sample
Finally understood why gamma and C must be tuned together. The log scale grid tip saved me hours.
About the teacher
Classical machine learning models, worked through on paper before any code
9 tutors 379 lessons taught Sample
I teach the classical machine learning models: regression, trees, ensembles, nearest neighbours, support vector machines and naive Bayes. My background is in applied analytics, where I spent a lot of time explaining to colleagues why a model made a particular prediction, and that shaped how I teach. I like to start with a tiny dataset you can hold in your...
See Kavya's profile and tutorsMore like this
Other tutors on the same or nearby topics.