CSci574 / AI 520 Machine Learning: Classroom Session 10/20/2026
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.
Transcript excerpt
0:08 Okay, I'm just waiting to see if we get some more people show up here. Is my audio okay for my online people? Am I coming through? >> Yeah, we can hear you. >> All right, thank you. Okay, give me one more moment here. All right, I'm going to go ahead and get
1:19 started. So, I guess I did post an announcement, but I did go ahead and get back the test one actually this morning. I didn't get to them until today. Um, so I don't know if I have anything that I need to review on the test one. Um, I'll just mention one or two general things. Oh, shoot. I thought I had it on here. Yeah, well, I won't to it up. So, um Uh in general, nobody had any real big issue. Uh I'll just remind people, you know, kind of for the future, both for
2:05 assignments and for tests, uh do make certain that, you know, all your code runs. Uh so, you know, I had uh the the most points got taken off for some people that had some submitted notebooks that had cells in there that weren't running, usually for a missing import or uh you know, like just a syntax error that's relatively simple, but um I I tend not to really understand how those can get past people because, I mean, I assume that uh you're running your stuff uh and checking it uh that it seems to be working or not. So, you know, when there's a a simple syntax error, I mean, it's unfortunate that you lose uh potentially quite a few points on things like that, but um uh but but yeah, in general, you know,
2:52 your notebook should run, whether it's an assignment or whether it's in a test
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
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.