🎯 Goal
Add a hands-on code snippet in Module 4 (04-machine-learning/README.md) that plots and compares the Decision Boundaries of Logistic Regression, Decision Trees, and Random Forests on a 2D synthetic dataset.
📌 Motivation
Students often find mathematical classification equations abstract until they visually see how a linear model creates a straight line decision boundary, whereas a Decision Tree produces orthogonal rectangular splits, and a Random Forest creates a smooth, non-linear contour.
📋 Scope and Requirements
- Target File:
04-machine-learning/README.md.
- Implementation Details:
- Generate a 2D dataset using
sklearn.datasets.make_moons or make_blobs.
- Fit 3 models:
LogisticRegression (Linear boundary)
DecisionTreeClassifier(max_depth=4) (Axis-aligned step boundary)
RandomForestClassifier(n_estimators=50) (Ensemble smoothed boundary)
- Use
matplotlib and numpy.meshgrid (or sklearn.inspection.DecisionBoundaryDisplay) to create a clean side-by-side 1x3 subplot figure.
- Include clear explanatory commentary on bias-variance tradeoffs observed in the plots.
🏷️ Good First Issue
Great visualization task for students learning Scikit-Learn and Matplotlib! Comment below to claim.
🎯 Goal
Add a hands-on code snippet in Module 4 (
04-machine-learning/README.md) that plots and compares the Decision Boundaries of Logistic Regression, Decision Trees, and Random Forests on a 2D synthetic dataset.📌 Motivation
Students often find mathematical classification equations abstract until they visually see how a linear model creates a straight line decision boundary, whereas a Decision Tree produces orthogonal rectangular splits, and a Random Forest creates a smooth, non-linear contour.
📋 Scope and Requirements
04-machine-learning/README.md.sklearn.datasets.make_moonsormake_blobs.LogisticRegression(Linear boundary)DecisionTreeClassifier(max_depth=4)(Axis-aligned step boundary)RandomForestClassifier(n_estimators=50)(Ensemble smoothed boundary)matplotlibandnumpy.meshgrid(orsklearn.inspection.DecisionBoundaryDisplay) to create a clean side-by-side 1x3 subplot figure.🏷️ Good First Issue
Great visualization task for students learning Scikit-Learn and Matplotlib! Comment below to claim.