CSci574 / AI 520 Machine Learning: Classroom Session 10/20/2026
Watch on YouTube →
Overview
Derek Harter introduces linear support vector machines as classifiers that modify logistic regression's cost function to favor maximum-margin decision boundaries, which can improve generalization. He explains feature scaling, outliers, the inverse relationship between the SVM parameter C and logistic regression's regularization parameter lambda, and scikit-learn distinctions; kernel methods for nonlinear boundaries are deferred to the next class.
Key takeaways
- A linear SVM modifies the classification loss to favor the maximum-margin boundary, which can generalize better than a boundary that only perfectly separates training examples.
- Scale SVM features before fitting: large differences in feature ranges can substantially alter the learned decision boundary.
- Small C permits more margin violations and favors a wider margin; large C penalizes violations more heavily and can make the classifier more sensitive to outliers.
- SVM's C is inversely related to logistic regression's lambda: small C corresponds to strong regularization, while large C corresponds to weak regularization.
- LinearSVC scores are not probabilities like logistic regression's sigmoid outputs; probability estimation with SVC requires an additional procedure.
- The next step beyond linear SVMs is kernel-based classification, which enables nonlinear decision boundaries.
Chapters
- Derek Harter says most Test 1 work was on track, but notebook cells with missing imports or syntax errors cost students points.
- He recommends checking that every submitted notebook runs and that its outputs match the requested task.
- Test 2 will be comprehensive, with most questions expected to cover support vector machines, decision trees, and possibly unsupervised learning.
- The support vector machine assignment is due Sunday, November 1, and students have the current week and following week to work on it.
- The course's Unit 10 lecture notebook covers support vector machines; K-nearest neighbors and naive Bayes are planned for the following week.
- Harter recommends Andrew Ng's class videos, especially the explanations of large-margin intuition and the mathematics behind it.
- A binary dataset is linearly separable when one line in two dimensions, or one hyperplane in higher dimensions, places each class on a different side.
- The Iris setosa and versicolor examples have infinitely many possible separating boundaries, but logistic regression does not necessarily choose the one with the widest margin.
- A support vector machine modifies the cost function to favor the boundary with the largest margin, the distance between the boundary and the nearest class examples.
- Several boundaries can classify the training Iris examples perfectly while sitting very close to one class's data points.
- A wider-margin boundary leaves more room for unseen flowers to vary in petal length or width before crossing the decision boundary.
- Maximum-margin classification is presented as a way to favor better generalization, rather than merely fitting the training set.
- SVM decision boundaries are sensitive to feature scales; Harter recommends scaling features so their numeric ranges are comparable.
- Even linearly separable data can produce a very different maximum-margin boundary when an outlier or mislabeled example is added.
- The regularization parameter C controls the tradeoff between a wide margin that allows violations and a narrower margin that tries to avoid them.
- C acts inversely to logistic regression's lambda: small C resembles large lambda, while large C resembles small lambda and makes the model more responsive to outliers.
- The notebook turns the Iris dataset into a binary task, virginica versus not virginica, using petal length and petal width.
- A StandardScaler is applied before fitting a linear support vector classifier, even though the two selected features have relatively similar scales.
- With small C, the model permits more margin violations and produces a wider margin; large C penalizes violations more strongly.
- The assignment's opening exercise uses a similar comparison of how C changes a decision boundary in the presence of outliers.
- Unlike logistic regression's sigmoid output, a linear SVC score is not directly interpretable as a probability of class membership.
- Harter distinguishes LinearSVC, which produces a linear boundary, from the more general SVC class, which can support nonlinear boundaries through settings such as kernels.
- SVC can estimate probabilities through an additional procedure, but probability estimates are not native to the SVM cost function.
- For logistic regression, the hypothesis starts with theta transposed times x and passes that value through a sigmoid to produce an output between zero and one.
- The logistic cost uses separate negative-log terms for labels 1 and 0, assigning low cost to correct confident predictions and higher cost to incorrect ones.
- Harter reviews this cost to show how the SVM changes the loss used during optimization.
- The SVM replaces logistic regression's logarithmic loss with a piecewise linear hinge-style loss that becomes zero once a prediction clears its margin threshold.
- For positive and negative examples, the desired score thresholds are approximately +1 and -1; encouraging scores beyond them supports a wider margin.
- The SVM objective uses C where logistic regression uses lambda, with small C corresponding to stronger regularization and large C to weaker regularization.
- Harter compares the piecewise loss to a rectified linear function and notes that the resulting SVM scores should not be treated as probabilities.
- Harter closes by postponing polynomial and other kernel methods, along with nonlinear decision boundaries, to the next class.
- The next lesson will explain how kernel features let an SVM fit nonlinear boundaries without explicitly carrying out all transformations in a high-dimensional feature space.
- The support vector machine assignment includes a kernel-feature task, so students will need the upcoming explanation.
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Derek Harter.