[ OK ]c6ac9022-69dd-401b-9f78-06466ecd59aa — full content available
[ INFO ]category: Coding · Ml Fundamentals difficulty: unknown freq: first seen: 2026-05-28
[UNKNOWN][ML FUNDAMENTALS]
$catproblem.md
ML Fundamentals
Problem Overview
This round is a fundamentals-heavy Machine Learning Engineer discussion. The interviewer typically starts with a simple supervised learning setup, then uses a plot of two overlapping classes to discuss concepts like decision boundaries, feature scaling, and regularization.
Problem Statement
Given a dataset with two overlapping classes, plot the decision boundary for a simple supervised learning model. Discuss how feature scaling affects the decision boundary and the importance of regularization in preventing overfitting.
Constraints
Use a simple supervised learning model like logistic regression or a linear support vector machine.
The dataset should have at least two features and two classes.
Discuss the impact of feature scaling on the decision boundary.
Explain the role of regularization in preventing overfitting.
Examples
Consider a dataset with two classes, A and B, and two features, X1 and X2. Plot the decision boundary for a logistic regression model trained on this dataset.
After plotting the decision boundary, scale the features X1 and X2 by different factors and observe how the decision boundary changes.
Train a logistic regression model with and without regularization (e.g., L2 regularization) on the dataset, and discuss the differences in the decision boundaries.
Hints
The decision boundary is the set of points where the model is equally confident in predicting each class.
Feature scaling can affect the decision boundary because it changes the relative importance of each feature.
Regularization adds a penalty term to the loss function, which can help prevent overfitting by discouraging large weights.
Solution
To solve this problem, follow these steps:
Load the dataset and split it into training and testing sets.
Train a simple supervised learning model (e.g., logistic regression) on the training set.
Plot the decision boundary by making predictions on a grid of points and visualizing the results.
Scale the features X1 and X2 by different factors and retrain the model. Plot the new decision boundary and compare it to the original one.
Train the model with and without regularization, and plot the decision boundaries for both cases. Discuss the differences and the role of regularization in preventing overfitting.
By following these steps, you can demonstrate your understanding of the fundamentals of supervised learning, decision boundaries, feature scaling, and regularization.