Computer Vision Crash Course In PythonLearn the fundamentals of computer vision with Python—simple, practical, and beginner-friendly.
Course Overview - Start Here!
Overview
In this fourth video, we’ll take the next big step in our journey: training a machine learning model to classify images of handwritten digits. Using the digit recognition dataset we explored in the last video, we’ll build and evaluate a Support Vector Machine (SVM) classifier.
Here’s what you’ll learn:
For the purpose of this video, the SVM can be seen as a black box. There are many such "boxes" that could be used for machine learning tasks, and learning which to use when is an art that takes time and experience. For advanced usage, you can explore the implementation details or even create your own algorithms. For now, it’s fine to see the SVM as a tool that learns to predict output values (like digit labels) from input values (like image data) based on the training data we feed it.
If you’re curious to dive deeper, the documentation for scikit-learn’s SVMs is available here.
By the end of this video, you’ll have a fully trained model, ready to classify digits and make predictions. You’ll also gain the skills to evaluate the model's accuracy and make data-driven improvements. Let’s get started!

In this video, we learned why it’s important to have a separate test dataset. The immense number of possible combinations in the input images far exceeds the number of images we have. This creates the risk that the model might simply memorize the images and labels rather than actually learning to understand them. By using a test dataset, we can evaluate how well the model generalizes to unseen data.
We used scikit-learn functions to split the dataset into training and testing sets and explored the splits to ensure they were correct. Next, we trained a Support Vector Machine (SVM) classifier, which achieved perfect accuracy on the training dataset. However, when evaluated on the test dataset, the model demonstrated a 99% F1 score—a standardized way of measuring accuracy—indicating a good performance while highlighting the value of using a test set.
This process gave us insights into how the model learns and allowed us to measure its ability to generalize beyond the training data. In the next video, we will learn how to use this model on our own images!