- Classical Machine Learning
- Dimensionality Reduction
- Machine Learning Workflows
- Objective Functions and Performance Metrices
-
What are the basic assumptions to be made for linear regression?
-
What happens if we don’t apply feature scaling to logistic regression?
-
What are the algorithms you’d use when developing the prototype of a fraud detection model?
-
Feature selection.
- Why do we use feature selection?
- What are some of the algorithms for feature selection? Pros and cons of each.
-
k-means clustering.
- How would you choose the value of k?
- If the labels are known, how would you evaluate the performance of your k-means clustering algorithm?
- How would you do it if the labels aren’t known?
- Given the following dataset, can you predict how K-means clustering works on it? Explain.
-
k-nearest neighbor classification.
- How would you choose the value of k?
- What happens when you increase or decrease the value of k?
- How does the value of k impact the bias and variance?
-
k-means and GMM are both powerful clustering algorithms.
- Compare the two.
- When would you choose one over another?
-
Bagging and boosting are two popular ensembling methods. Random forest is a bagging example while XGBoost is a boosting example.
- What are some of the fundamental differences between bagging and boosting algorithms?
- How are they used in deep learning?
-
Given this directed graph.
- Construct its adjacency matrix.
- How would this matrix change if the graph is now undirected?
- What can you say about the adjacency matrices of two isomorphic graphs?
-
Imagine we build a user-item collaborative filtering system to recommend to each user items similar to the items they’ve bought before.
- You can build either a user-item matrix or an item-item matrix. What are the pros and cons of each approach?
- How would you handle a new user who hasn’t made any purchases in the past?
-
Is feature scaling necessary for kernel methods?
-
Naive Bayes classifier.
- How is Naive Bayes classifier naive?
- Let’s try to construct a Naive Bayes classifier to classify whether a tweet has a positive or negative sentiment. We have four training samples:
$$\begin{bmatrix} Tweet & Label \\\ This makes me so upset & Negative\\\ This puppy makes me happy & Positive \\\ Look at this happy hamster & Positive \\\ No hamsters allowed in my house & Negative \end{bmatrix}$$ According to your classifier, what's sentiment of the sentence The hamster is upset with the puppy?
-
Two popular algorithms for winning Kaggle solutions are Light GBM and XGBoost. They are both gradient boosting algorithms.
- What is gradient boosting?
- What problems is gradient boosting good for?
-
SVM.
- What’s linear separation? Why is it desirable when we use SVM?
- How well would vanilla SVM work on this dataset?
- How well would vanilla SVM work on this dataset?
- Why do we need dimensionality reduction?
- Eigendecomposition is a common factorization technique used for dimensionality reduction. Is the eigendecomposition of a matrix always unique?
- Name some applications of eigenvalues and eigenvectors.
- We want to do PCA on a dataset of multiple features in different ranges. For example, one is in the range
$0-1$ and one is in the range$10 - 1000$ . Will PCA work on this dataset? - Under what conditions can one apply eigendecomposition? What about SVD?
- What is the relationship between SVD and eigendecomposition?
- What’s the relationship between PCA and SVD?
- How does
$t-SNE$ (T-distributed Stochastic Neighbor Embedding) work? Why do we need it?
- Explain supervised, unsupervised, weakly supervised, semi-supervised, and active learning.
- Empirical risk minimization.
- What’s the risk in empirical risk minimization?
- Why is it empirical?
- How do we minimize that risk?
- Occam's razor states that when the simple explanation and complex explanation both work equally well, the simple explanation is usually correct. How do we apply this principle in ML?
- What are the conditions that allowed deep learning to gain popularity in the last decade?
- If we have a wide NN and a deep NN with the same number of parameters, which one is more expressive and why?
- The Universal Approximation Theorem states that a neural network with 1 hidden layer can approximate any continuous function for inputs within a specific range. Then why can’t a simple neural network reach an arbitrarily small positive error?
- What are saddle points and local minima? Which are thought to cause more problems for training large NNs?
- Hyperparameters.
- What are the differences between parameters and hyperparameters?
- Why is hyperparameter tuning important?
- Explain algorithm for tuning hyperparameters.
- Classification vs. regression.
- What makes a classification problem different from a regression problem?
- Can a classification problem be turned into a regression problem and vice versa?
- Parametric vs. non-parametric methods.
- What’s the difference between parametric methods and non-parametric methods? Give an example of each method.
- When should we use one and when should we use the other?
- Why does ensembling independently trained models generally improve performance?
- Why does L1 regularization tend to lead to sparsity while L2 regularization pushes weights closer to 0?
- Why does an ML model’s performance degrade in production?
- What problems might we run into when deploying large machine learning models?
- Your model performs really well on the test set but poorly in production.
- What are your hypotheses about the causes?
- How do you validate whether your hypotheses are correct?
- Imagine your hypotheses about the causes are correct. What would you do to address them?
-
If you have 6 shirts and 4 pairs of pants, how many ways are there to choose 2 shirts and 1 pair of pants?
-
What is the difference between sampling with vs. without replacement? Name an example of when you would use one rather than the other?
-
Explain Markov chain Monte Carlo sampling.
-
If you need to sample from high-dimensional data, which sampling method would you choose?
-
Suppose we have a classification task with many classes. An example is when you have to predict the next word in a sentence -- the next word can be one of many, many possible words. If we have to calculate the probabilities for all classes, it’ll be prohibitively expensive. Instead, we can calculate the probabilities for a small set of candidate classes. This method is called candidate sampling. Name and explain some of the candidate sampling algorithms.
-
Suppose you want to build a model to classify whether a Reddit comment violates the website’s rule. You have
$10$ million unlabeled comments from$10K$ users over the last$24$ months and you want to label$100K$ of them.- How would you sample
$100K$ comments to label? - Suppose you get back
$100K$ labeled comments from$20$ annotators and you want to look at some labels to estimate the quality of the labels. How many labels would you look at? How would you sample them?
- How would you sample
-
Suppose you work for a news site that historically has translated only
$1%$ of all its articles. Your coworker argues that we should translate more articles into Chinese because translations help with the readership. On average, your translated articles have twice as many views as your non-translated articles. What might be wrong with this argument? -
How to determine whether two sets of samples (e.g. train and test splits) come from the same distribution?
-
How do you know you’ve collected enough samples to train your ML model?
-
How to determine outliers in your data samples? What to do with them?
-
Sample duplication
- When should you remove duplicate training samples? When shouldn’t you?
- What happens if we accidentally duplicate every data point in your train set or in your test set?
-
Missing data
- In your dataset, two out of 20 variables have more than 30% missing values. What would you do?
- How might techniques that handle missing data make selection bias worse? How do you handle this bias?
-
Why is randomization important when designing experiments (experimental design)?
-
Class imbalance.
- How would class imbalance affect your model?
- Why is it hard for ML models to perform well on data with class imbalance?
- Imagine you want to build a model to detect skin legions from images. In your training dataset, only
$1%$ of your images shows signs of legions. After training, your model seems to make a lot more false negatives than false positives. What are some of the techniques you'd use to improve your model?
-
Training data leakage.
- Imagine you're working with a binary task where the positive class accounts for only 1% of your data. You decide to oversample the rare class then split your data into train and test splits. Your model performs well on the test split but poorly in production. What might have happened?
- You want to build a model to classify whether a comment is spam or not spam. You have a dataset of a million comments over the period of 7 days. You decide to randomly split all your data into the train and test splits. Your co-worker points out that this can lead to data leakage. How?
-
How does data sparsity affect your models?
-
Feature leakage
- What are some causes of feature leakage?
- Why does normalization help prevent feature leakage?
- How do you detect feature leakage?
-
Suppose you want to build a model to classify whether a tweet spreads misinformation. You have 100K labeled tweets over the last 24 months. You decide to randomly shuffle on your data and pick 80% to be the train split, 10% to be the valid split, and 10% to be the test split. What might be the problem with this way of partitioning?
-
You’re building a neural network and you want to use both numerical and textual features. How would you process those different features?
-
Your model has been performing fairly well using just a subset of features available in your data. Your boss decided that you should use all the features available instead. What might happen to the training error? What might happen to the test error?
-
Convergence.
- When we say an algorithm converges, what does convergence mean?
- How do we know when a model has converged?
-
Draw the loss curves for overfitting and underfitting.
-
Bias-variance trade-off
- What’s the bias-variance trade-off?
- How’s this tradeoff related to overfitting and underfitting?
- How do you know that your model is high variance, low bias? What would you do in this case?
- How do you know that your model is low variance, high bias? What would you do in this case?
-
Cross-validation.
- Explain different methods for cross-validation.
- Why don’t we see more cross-validation in deep learning?
-
Train, valid, test splits.
- What’s wrong with training and testing a model on the same data?
- Why do we need a validation set on top of a train set and a test set?
- Your model’s loss curves on the train, valid, and test sets look like this. What might have been the cause of this? What would you do?
-
Your team is building a system to aid doctors in predicting whether a patient has cancer or not from their X-ray scan. Your colleague announces that the problem is solved now that they’ve built a system that can predict with 99.99% accuracy. How would you respond to that claim?
-
F1 score.
- What’s the benefit of F1 over the accuracy?
- Can we still use F1 for a problem with more than two classes. How?
-
Given a binary classifier that outputs the following confusion matrix.
1. Calculate the model’s precision, recall, and F1.
1. What can we do to improve the model’s performance?
- Consider a classification where
$99%$ of data belongs to class A and$1%$ of data belongs to class B.- If your model predicts A 100% of the time, what would the F1 score be? Hint: The F1 score when A is mapped to 0 and B to 1 is different from the F1 score when A is mapped to 1 and B to 0.
- If we have a model that predicts A and B at a random (uniformly), what would the expected
$F_1$ be?
- For logistic regression, why is log loss recommended over MSE (mean squared error)?
- When should we use RMSE (Root Mean Squared Error) over MAE (Mean Absolute Error) and vice versa?
- Show that the negative log-likelihood and cross-entropy are the same for binary classification tasks.
- For classification tasks with more than two labels (e.g. MNIST with
$10$ labels), why is cross-entropy a better loss function than MSE? - Consider a language with an alphabet of
$27$ characters. What would be the maximal entropy of this language? - A lot of machine learning models aim to approximate probability distributions. Let’s say P is the distribution of the data and Q is the distribution learned by our model. How do measure how close Q is to P?
- MPE (Most Probable Explanation) vs. MAP (Maximum A Posteriori)
- How do MPE and MAP differ?
- Give an example of when they would produce different results.
- Suppose you want to build a model to predict the price of a stock in the next 8 hours and that the predicted price should never be off more than
$10%$ from the actual price. Which metric would you use?