Supervised Learning Categories
Supervised learning is divided into two main tasks:
- Regression: Predicting a continuous numerical value (e.g., house prices).
- Classification: Predicting a discrete category or label (e.g., spam vs. not spam).
Classification: Beyond the Basics
We already saw the Estimator API. Let’s look at more complex classifiers.
Support Vector Machines (SVM)
SVMs are powerful models that attempt to find the hyperplane that best separates classes with the maximum margin.
Decision Trees and Random Forests
Decision Trees mimic human decision-making by splitting data based on feature thresholds. Random Forests are “ensembles” of many decision trees, which reduces overfitting.
Regression: Complexity and Regularization
Simple linear regression often underfits complex data. We can use techniques like Ridge and Lasso regression to prevent overfitting by penalizing large coefficients.
Hyperparameter Tuning
How do we choose the best alpha for Ridge or the best n_estimators for a Random Forest? We use Grid Search.
Pipelines: Chaining Transformations
A pipeline combines a series of preprocessing steps and a final estimator into one object. This prevents data leakage during cross-validation.
In the next module, we’ll explore Unsupervised Learning techniques like Clustering and Dimensionality Reduction.