DecodeAI
← Question Bank

Machine Learning

General Concepts In Machine Learning

Interview questions on General Concepts In Machine Learning.

29 questions

Sampling Techniques and Creating Training Data

Q1. If you have 6 shirts and 4 pairs of pants, how many ways are there to choose 2 shirts and 1 pair of pants?

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q2. What is the difference between sampling with vs. without replacement? Name an example of when you would use one rather than the other?

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q3. Explain Markov chain Monte Carlo sampling.

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q4. If you need to sample from high-dimensional data, which sampling method would you choose?

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q5. 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.

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q6. 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.

Sign in to bookmark
  1. How would you sample 100K100K comments to label?
    1. Suppose you get back 100K100K labeled comments from 2020 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?

Sampling Techniques and Creating Training Data

Q7. 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?

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q8. How to determine whether two sets of samples (e.g. train and test splits) come from the same distribution?

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q9. How do you know you’ve collected enough samples to train your ML model?

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q10. How to determine outliers in your data samples? What to do with them?

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q11. Sample duplication

Sign in to bookmark
  1. When should you remove duplicate training samples? When shouldn’t you?
  2. What happens if we accidentally duplicate every data point in your train set or in your test set?

Sampling Techniques and Creating Training Data

Q12. Missing data

Sign in to bookmark
  1. In your dataset, two out of 20 variables have more than 30% missing values. What would you do?
  2. How might techniques that handle missing data make selection bias worse? How do you handle this bias?

Sampling Techniques and Creating Training Data

Q13. Why is randomization important when designing experiments (experimental design)?

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q14. Class imbalance.

Sign in to bookmark
  1. How would class imbalance affect your model?
  2. Why is it hard for ML models to perform well on data with class imbalance?
  3. Imagine you want to build a model to detect skin legions from images. In your training dataset, only 11% 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?

Sampling Techniques and Creating Training Data

Q15. Training data leakage.

Sign in to bookmark
  1. 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?
  2. 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?

Sampling Techniques and Creating Training Data

Q16. How does data sparsity affect your models?

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q17. Feature leakage

Sign in to bookmark
  1. What are some causes of feature leakage?
  2. Why does normalization help prevent feature leakage?
  3. How do you detect feature leakage?

Sampling Techniques and Creating Training Data

Q18. 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?

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q19. 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?

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q20. Convergence.

Sign in to bookmark
  1. When we say an algorithm converges, what does convergence mean?
  2. How do we know when a model has converged?

Sampling Techniques and Creating Training Data

Q21. Draw the loss curves for overfitting and underfitting.

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q22. While working on a modeling use case, you notice that your model is underfitting. What steps would you take to address this issue?

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q23. While working on a modeling use case, you observe that your model is overfitting. What steps would you take to resolve this?

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q24. Bias-variance trade-off

Sign in to bookmark
  1. What’s the bias-variance trade-off?
  2. How’s this tradeoff related to overfitting and underfitting?
  3. How do you know that your model is high variance, low bias? What would you do in this case?
  4. How do you know that your model is low variance, high bias? What would you do in this case?

Sampling Techniques and Creating Training Data

Q25. What are the potential drawbacks of using the validation set approach for estimating the test error rate?

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q26. Cross-validation.

Sign in to bookmark
  1. Explain different methods for cross-validation.
  2. Why don’t we see more cross-validation in deep learning?

Sampling Techniques and Creating Training Data

Q27. Is LOOCV a special case of k-fold CV?

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q28. Explain the bias variance tradeoff with the choice of k in k-fold validation?

Sign in to bookmark

Sampling Techniques and Creating Training Data

Q29. Train, valid, test splits.

Sign in to bookmark
  1. What’s wrong with training and testing a model on the same data?
  2. Why do we need a validation set on top of a train set and a test set?
  3. 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? image