DecodeAI
← Question Bank

Machine Learning

Tree Based Methods in Machine Learning

Interview questions on Tree Based Methods in Machine Learning.

91 questions

Decision Trees

Q2. What is the purpose of decision trees in machine learning?

Sign in to bookmark

Decision Trees

Q4. What is over-fitting in decision trees, and how can it be prevented?

Sign in to bookmark

Decision Trees

Q5. What are some common impurity measures used in decision tree algorithms?

Sign in to bookmark

Decision Trees

Q6. List down pros and cons of different splitting criteria?

Sign in to bookmark

Decision Trees

Q8. Can decision trees handle categorical data, and how is it done?

Sign in to bookmark

Decision Trees

Q9. What are some advantages of decision trees in machine learning?

Sign in to bookmark

Decision Trees

Q13. What are the steps involved in building a decision tree with ID3?

Sign in to bookmark

Decision Trees

Q17. Can you explain how the concept of entropy is used in ID3?

Sign in to bookmark

Decision Trees

Q18. What are different criteria along which the implementation of DTs varies?

Sign in to bookmark

Decision Trees

Q19. What is the difference between CART and ID3/C4.5?

Sign in to bookmark

Ensemble Learning

Q21. Mark all the approaches which can be utilized to boost a single model performance:

Sign in to bookmark
  1. Majority Voting
  2. Using K-identical base-learning algorithms
  3. Using K-different base-learning algorithms
  4. Using K-different data-folds
  5. Using K-different random number seeds
  6. A combination of all the above approaches

Ensemble Learning

Q22. What are the key components of a stacking ensemble?

Sign in to bookmark

Ensemble Learning

Q23. How do you prevent over-fitting in a stacked ensemble?

Sign in to bookmark

Ensemble Learning

Q24. Can you explain the process of creating a stacking ensemble?

Sign in to bookmark

Ensemble Learning

Q25. What is the advantage of stacking over using a single powerful model?

Sign in to bookmark

Ensemble Learning

Q26. What are some popular algorithms used as base models in stacking ensembles?

Sign in to bookmark

Ensemble Learning

Q27. When should you consider using stacking in a machine learning project?

Sign in to bookmark

Ensemble Learning

Q29. Can you explain the difference between stacking and blending?

Sign in to bookmark

Ensemble Learning

Q30. What is the purpose of a meta-model in blending?

Sign in to bookmark

Ensemble Learning

Q32. What are the common algorithms used for blending?

Sign in to bookmark

Ensemble Learning

Q33. What precautions should you take when implementing blending?

Sign in to bookmark

Ensemble Learning

Q34. Can you explain the difference between bagging, boosting, and blending?

Sign in to bookmark

Ensemble Learning

Q35. When should you consider using blending in a machine learning project?

Sign in to bookmark

Ensemble Learning

Q36. What challenges can arise when implementing blending in practice?

Sign in to bookmark

Ensemble Learning

Q37. An argument erupts between two senior data-scientists regarding the choice of an approach for training of a very small medical corpus. One suggest that bagging is superior while the other suggests stacking. Which technique, bagging or stacking, in your opinion is superior? Explain in detail.

Sign in to bookmark
  1. Stacking since each classier is trained on all of the available data.
  2. Bagging since we can combine as many classifiers as we want by training each on a different sub-set of the training corpus.

Ensemble Learning

Q38. Below Fig depicts a part of a specific ensembling approach applied to the models $x1, x2...xk$.

Sign in to bookmark

In your opinion, which approach is being utilized?

Ensemble Learning

Q39. 1. **True or false**: Training an ensemble of a single monolithic architecture results in lower model diversity and possibly decreased model prediction accuracy.

Sign in to bookmark
  1. True or false: The generalization accuracy of an ensemble increases with the number of well-trained models it consists of.
  2. True or false: Bootstrap aggregation (or bagging), refers to a process wherein a CNN ensemble is being trained using a random subset of the training corpus.
  3. True or false: Bagging assumes that if the single predictor shave independent errors, then a majority vote of their outputs should be better than the individual predictions.

Ensemble Learning

Q40. 1. In a transfer-learning experiment conducted by a researcher, a number of ImageNet-pretrained CNN classifiers, selected from Table 6.1 are trained on five different folds drawn from the same corpus. Their outputs are fused together producing a composite machine. Ensembles of these convolutional neural networks architectures have been extensively studies an evaluated in various ensembling approaches. Is it likely that the composite machine will produce a prediction with higher accuracy than that of any individual classifier? Explain why.

Sign in to bookmark

Ensemble Learning

Q41. In committee machines, mark all the combiners that do not make direct use of the input:

Sign in to bookmark
  1. A mixture of experts
  2. Bagging
  3. Ensemble averaging
  4. Boosting

Ensemble Learning

Q42. Refer to the papers: <a href='https://arxiv.org/pdf/1506.02142.pdf'>Dropout as a Bayesian Approximation</a> and <a href='https://arxiv.org/pdf/1906.02530.pdf'>Can You TrustYour Model’s Uncertainty?</a> and answer the following question:

Sign in to bookmark
  1. Do deep ensembles achieve a better performance on out-of-distribution uncertainty benchmarks compared with Monte-Carlo (MC)-dropout?

Ensemble Learning

Q43. **True or False**: Considering a binary classification problem $(y = 0\ or \ y = 1)$, ensemble averaging, wherein the outputs of individual models are linearly combined to produce a fused output is a form of a static committee machine.

Sign in to bookmark

Ensemble Learning

Q44. **True or false**: When using a single model, the risk of overfitting the data increases when

Sign in to bookmark

the number of adjustable parameters is large compared to cardinality (i.e., size of the set) of the training corpus.

Ensemble Learning

Q45. **True or false**: If we have a committee of $K$ trained models and the errors are uncorrelated, then by averaging them the average error of a model is reduced by a factor of $K$.

Sign in to bookmark

Ensemble Learning

Q46. 1. Define ensemble learning in the context of machine learning.

Sign in to bookmark
  1. Provide examples of ensemble methods in classical machine-learning.
  2. True or false: Ensemble methods usually have stronger generalization ability.
  3. Complete the sentence: Bagging is variance/bias reduction scheme while boosting reduced variance/bias.

Ensemble Learning

Q47. Your colleague, a well-known expert in ensembling methods, writes the following pseudo-code in Python shown in Fig. 6.7 for the training of a neural network. This runs inside a standard loop in each training and validation step.

Sign in to bookmark
  import torchvision.models as models ...
  models = ['resnext']
  for m in models: 
      train ...
      compute VAL loss ... 
      amend LR ...
      if (val_acc > 90.0):
          saveModel()
  1. What type of ensembling can be used with this approach? Explain in detail.
  2. What is the main advantage of snapshot ensembling? What are the disadvantages, if any?

Ensemble Learning

Q48. Assume further that your colleague amends the code as follows.

Sign in to bookmark
  import torchvision.models as models
  import random
  import np
  ...
  models = ['resnext']
  for m in models:
      train ...
      compute loss ...
      amend LR ...
      manualSeed= draw a new random number
      random.seed(manualSeed)
      np.random.seed(manualSeed)
      torch.manual_seed(manualSeed)
      if (val_acc > 90.0):
          saveModel()

Explain in detail what would be the possible effects of adding lines 10-13.

Ensemble Learning

Q49. 1. Assume your colleague, a veteran in DL and an expert in ensembling methods writes the following Pseudo code shown in Fig. 6.9 for the training of several neural networks. This code snippet is executed inside a standard loop in each and every training/validation epoch.

Sign in to bookmark
    import torchvision.models as models 
    ...
    models = ['resnext','vgg','dense']
    for m in models: 
        train ...
        compute loss/acc 
        ... 
        if (val_acc > 90.0):
            saveModel()
    ```
    What type of ensembling is being utilized in this approach? Explain in detail.
2. Name one method by which NN models may be combined to yield a single prediction.

Ensemble Learning

Q50. 1. Referring to Below fig. which depicts a specific learning rate schedule, describe the basic notion behind its mechanism.

Sign in to bookmark

Ensemble Learning

Q51. Two popular algorithms for winning Kaggle solutions are Light GBM and XGBoost. They are both gradient boosting algorithms.

Sign in to bookmark
  1. What is gradient boosting?
  2. What problems is gradient boosting good for?

Random Forest

Q52. Complete the sentence: A random forest is a type of a decision tree which utilizes `[bagging/boosting]`

Sign in to bookmark

Random Forest

Q53. The algorithm depicted in Fig. 6.1 was found in an old book about ensembling. Name the

Sign in to bookmark

algorithm.

Algorithm 1: Algo 1

Data: A set of training data, Q with N elements has been established while K times do Create a random subset of N ′ data by sampling from Q containing the N samples; N′ < N; Execute algorithm Algo 2; Return all N′ back to Q

Algorithm 2: Algo 2

Choose a learner hmh_m; while K times do Pick a training set and train with hmh_m;

Random Forest

Q54. What is a Random Forest, and how does it work?

Sign in to bookmark

Random Forest

Q55. How do you choose between different types of decision tree algorithms (e.g., CART, ID3, C4.5, Random Forest)?

Sign in to bookmark

Random Forest

Q56. What is the difference between a decision tree and a Random Forest?

Sign in to bookmark

Random Forest

Q58. What is the purpose of feature bagging in a Random Forest?

Sign in to bookmark

Random Forest

Q60. What are the advantages of using Random Forests?

Sign in to bookmark

Random Forest

Q61. What is out-of-bag error, and how is it used in Random Forests?

Sign in to bookmark

Random Forest

Q63. Can you explain the concept of feature importance in a Random Forest?

Sign in to bookmark

Random Forest

Q64. What are some potential drawbacks of using Random Forests?

Sign in to bookmark

Random Forest

Q65. When would you choose a Random Forest over other machine learning algorithms?

Sign in to bookmark

Random Forest

Q66. Consider training corpus consisting of balls which are glued together as triangles, each

Sign in to bookmark

of which has either 1,3,6,10,15,21,28,36,or45balls1, 3, 6, 10, 15, 21, 28, 36, \hspace{0.1em}\text{or} \hspace{0.1em} 45 \hspace{0.5em} \text{balls}.

  1. We draw several samples from this corpus as presented in Fig.6.3 where in each sample is equiprobable. What type of sampling approach is being utilized here?
  2. Two samples are drawn one after the other. In which of the following cases is the covariance between the two samples equals zero? - (i) Sampling without replacement - (ii) Sampling with replacement
  3. During training, the corpus sampled with replacement and is divided into several folds as presented in Fig. 6.4.

Random Forest

Q67. There are several methods by which the outputs of base classifiers can be combined to yield a single prediction. Below code snippet depicts part of a specific ensembling approach applied to several CNN model predictions for a labelled data-set. Which approach is being utilized?

Sign in to bookmark
  1. Majority voting for binary classification
  2. Weighted majority voting for binary classification
  3. Majority voting for class probabilities (iv) Weighted majority class probabilities
  4. An algebraic weighted average for class probabilities
  5. An adaptive weighted majority voting for combining multiple classifiers
l=[]
for i,f in enumerate(filelist):
    temp = pd.read_csv(f)
    l.append(temp)
arr = np.stack(l,axis=-1)
avg_results = pd.DataFrame(arr[:,:-1,:].mean(axis=2))
avg_results['image'] = l[0]['image']
avg_results.columns = l[0].columns

Random Forest

Q68. **True or False**: A perfect ensemble comprises of highly correct classifiers that differ as much as possible.

Sign in to bookmark

Boosting based Algorithms

Q70. What are the advantages of bagging over decision trees?

Sign in to bookmark

Boosting based Algorithms

Q71. How does bagging reduces the variance in decision trees?

Sign in to bookmark

Boosting based Algorithms

Q72. What are some popular algorithms that use bagging?

Sign in to bookmark

Boosting based Algorithms

Q73. What's the difference between bagging and boosting?

Sign in to bookmark

Boosting based Algorithms

Q74. How does bagging handle imbalanced datasets?

Sign in to bookmark

Boosting based Algorithms

Q75. Can bagging be used with any base model?

Sign in to bookmark

Boosting based Algorithms

Q76. What are some potential drawbacks of bagging?

Sign in to bookmark

Boosting based Algorithms

Q77. What is the trade-off between bagging and variance?

Sign in to bookmark

Boosting based Algorithms

Q78. **True or false**: In bagging, we re-sample the training corpus with replacement and there-

Sign in to bookmark

fore this may lead to some instances being represented numerous times while other instances not to be represented at all.

Boosting based Algorithms

Q79. Bagging and boosting are two popular ensembling methods. Random forest is a bagging example while XGBoost is a boosting example.

Sign in to bookmark
  1. What are some of the fundamental differences between bagging and boosting algorithms?
  2. How are they used in deep learning?

Boosting based Algorithms

Q81. What are some popular boosting algorithms?

Sign in to bookmark

Boosting based Algorithms

Q82. What is the key idea behind AdaBoost?

Sign in to bookmark

Boosting based Algorithms

Q83. What is overfitting, and how does boosting address it?

Sign in to bookmark

Boosting based Algorithms

Q84. Can boosting models handle noisy data?

Sign in to bookmark

Boosting based Algorithms

Q85. What are the hyperparameters in boosting algorithms?

Sign in to bookmark

Boosting based Algorithms

Q86. What is the key idea behind XGBoost?

Sign in to bookmark

Boosting based Algorithms

Q87. What are some advantages of using XGBoost?

Sign in to bookmark

Boosting based Algorithms

Q88. How does LightGBM differ from traditional gradient boosting algorithms?

Sign in to bookmark

Boosting based Algorithms

Q89. What is the trade-off between LightGBM's speed and memory consumption?

Sign in to bookmark

Boosting based Algorithms

Q90. How does CatBoost handle categorical features?

Sign in to bookmark

Boosting based Algorithms

Q91. What are some benefits of using CatBoost for gradient boosting?

Sign in to bookmark