Sampling Techniques and Creating Training Data
Machine Learning
General Concepts In Machine Learning
Interview questions on General Concepts In Machine Learning.
29 questions
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?
Sampling Techniques and Creating Training Data
Q3. Explain Markov chain Monte Carlo sampling.
Sampling Techniques and Creating Training Data
Q4. If you need to sample from high-dimensional data, which sampling method would you choose?
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.
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.
- How would you sample comments to label?
- Suppose you get back labeled comments from 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?
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?
Sampling Techniques and Creating Training Data
Q9. How do you know you’ve collected enough samples to train your ML model?
Sampling Techniques and Creating Training Data
Q10. How to determine outliers in your data samples? What to do with them?
Sampling Techniques and Creating Training Data
Q11. 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?
Sampling Techniques and Creating Training Data
Q12. 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?
Sampling Techniques and Creating Training Data
Q13. Why is randomization important when designing experiments (experimental design)?
Sampling Techniques and Creating Training Data
Q14. 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 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.
- 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?
Sampling Techniques and Creating Training Data
Q16. How does data sparsity affect your models?
Sampling Techniques and Creating Training Data
Q17. Feature leakage
- What are some causes of feature leakage?
- Why does normalization help prevent feature leakage?
- 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?
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?
Sampling Techniques and Creating Training Data
Q20. Convergence.
- When we say an algorithm converges, what does convergence mean?
- How do we know when a model has converged?
Sampling Techniques and Creating Training Data
Q21. Draw the loss curves for overfitting and underfitting.
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?
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?
Sampling Techniques and Creating Training Data
Q24. 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?
Sampling Techniques and Creating Training Data
Q25. What are the potential drawbacks of using the validation set approach for estimating the test error rate?
Sampling Techniques and Creating Training Data
Q26. Cross-validation.
- Explain different methods for cross-validation.
- 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?
Sampling Techniques and Creating Training Data
Q28. Explain the bias variance tradeoff with the choice of k in k-fold validation?
Sampling Techniques and Creating Training Data
Q29. 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?
