Supervised models practice problems
18 problems · 0 solved
Supervised learning means learning from labelled examples to predict labels for new data. Before deep learning, a family of classic models handled most of this work, and they still win on many tabular problems. A decision tree, for example, works like a game of twenty questions, asking simple yes or no questions until it reaches an answer. These problems ask you to build these models from scratch. You will classify by majority vote of nearest neighbours and with distance weighting, classify by the nearest centroid, run an epoch of the perceptron rule, compute information gain, find the best tree split with Gini impurity, grow a depth-limited regression tree, run a round of gradient boosting for squared error, boost decision stumps with AdaBoost, predict with Gaussian Naive Bayes, and train a linear SVM with hinge loss subgradient descent. Start with the Easy problems on k nearest neighbours, centroids and the perceptron. Then do tree splits, gradient boosting and the SVM, and finish with full trees, AdaBoost and Naive Bayes. Fintech and analytics teams use tree models daily, and these algorithms are standard questions in data science interviews.
Easy 5
Medium 10
- Find the best decision tree split with Gini impurity
- Train a linear SVM with hinge loss subgradient descent
- Predict with distance-weighted k nearest neighbours
- Run one round of gradient boosting for squared error
- Classify word-count vectors with multinomial Naive Bayes
- Classify binary feature vectors with Bernoulli Naive Bayes
- Compute information gain and gain ratio for a categorical split
- Score a random forest with out-of-bag votes
- Find the best split with the XGBoost gain formula
- Find Fisher's linear discriminant direction for two classes