Previously, we focused on regression for predicting continuous numbers. This chapter shifts to classification, where the goal is to assign data points to predefined categories or classes. Unlike regression where the target variable y is continuous, in classification, y belongs to a finite set of discrete categories, such as {Spam, Not Spam} or {Cat, Dog, Bird}.
We will examine several common classification algorithms available in Scikit-learn. You will learn to implement Logistic Regression, a linear model adapted for classification tasks, K-Nearest Neighbors (KNN), an instance-based approach, and the fundamentals of Support Vector Machines (SVM). A significant aspect involves evaluating these models effectively. We will introduce metrics specifically designed for classification, including accuracy, precision, recall, F1-score, and the confusion matrix, and demonstrate how to compute them using Scikit-learn functions. You will gain practical experience in building and assessing standard classification models.
3.1 Introduction to Classification Problems
3.2 Logistic Regression for Classification
3.3 K-Nearest Neighbors (KNN) Algorithm
3.4 Implementing KNN with Scikit-learn
3.5 Support Vector Machines (SVM) Basics
3.6 Implementing SVM with Scikit-learn
3.7 Classification Evaluation Metrics
3.8 Calculating Metrics in Scikit-learn
3.9 Hands-on Practical: Building Classification Models
© 2025 ApX Machine Learning