Machine Learning Interview Questions and Answers
Question - 61 : - What is Entropy in Machine Learning?
Answer - 61 : -
Entropy in Machine Learning measures the randomness in the data that needs to be processed. The more entropy in the given data, the more difficult it becomes to draw any useful conclusion from the data. For example, let us take the flipping of a coin. The result of this act is random as it does not favor heads or tails. Here, the result for any number of tosses cannot be predicted easily as there is no definite relationship between the action of flipping and the possible outcomes.
Question - 62 : - What is Epoch in Machine Learning?
Answer - 62 : -
Epoch in Machine Learning is used to indicate the count of passes in a given training dataset where the Machine Learning algorithm has done its job. Generally, when there is a large chunk of data, it is grouped into several batches. All these batches go through the given model, and this process is referred to as iteration. Now, if the batch size comprises the complete training dataset, then the count of iterations is the same as that of epochs.
In case there is more than one batch, d*e=i*b is the formula used, wherein d is the dataset, e is the number of epochs, i is the number of iterations, and b is the batch size.
Question - 63 : - What is the Variance Inflation Factor?
Answer - 63 : -
Variance inflation factor (VIF) is the estimate of the volume of multicollinearity in a collection of many regression variables.
VIF = Variance of the model / Variance of the model with a single independent variable
This ratio has to be calculated for every independent variable. If VIF is high, then it shows the high collinearity of the independent variables.
Question - 64 : - When should Classification be used over Regression?
Answer - 64 : -
Both classification and regression are associated with prediction. Classification involves the identification of values or entities that lie in a specific group. Regression entails predicting a response value from consecutive sets of outcomes.
Classification is chosen over regression when the output of the model needs to yield the belongingness of data points in a dataset to a particular category.
For example, If you want to predict the price of a house, you should use regression since it is a numerical variable. However, if you are trying to predict whether a house situated in a particular area is going to be high-, medium-, or low-priced, then a classification model should be used.
Question - 65 : - How to handle Missing or Corrupted Data in a Dataset?
Answer - 65 : -
In Python pandas, there are two methods to locate lost or corrupted data and discard those values:
- isNull(): It can be used for detecting the missing values.
- dropna(): It can be used for removing columns or rows with null values.
- fillna() can be used to fill the void values with placeholder values.
Question - 66 : - Why is rotation required in PCA? What will happen if the components are not rotated?
Answer - 66 : -
Rotation is a significant step in principal component analysis (PCA.) Rotation maximizes the separation within the variance obtained by the components. This makes the interpretation of the components easier.
The motive behind conducting PCA is to choose fewer components that can explain the greatest variance in a dataset. When rotation is performed, the original coordinates of the points get changed. However, there is no change in the relative position of the components.
If the components are not rotated, then there needs to be more extended components to describe the variance.
Question - 67 : - Both being Tree-based Algorithms, how is Random Forest different from Gradient Boosting Machine (GBM)?
Answer - 67 : -
The main difference between a random forest and GBM is the use of techniques. Random forest advances predictions using a technique called bagging. On the other hand, GBM advances predictions with the help of a technique called boosting.
- Bagging: In bagging, we apply arbitrary sampling and we divide the dataset into N. After that, we build a model by employing a single training algorithm. Following that, we combine the final predictions by polling. Bagging helps to increase the efficiency of a model by decreasing the variance to eschew overfitting.
- Boosting: In boosting, the algorithm tries to review and correct the inadmissible predictions at the initial iteration. After that, the algorithm’s sequence of iterations for correction continues until we get the desired prediction. Boosting assists in reducing bias and variance for strengthening the weak learners.
Question - 68 : - Differentiate between Sigmoid and Softmax Functions
Answer - 68 : -
Sigmoid and Softmax functions differ based on their usage in Machine Learning task classification. Sigmoid function is used in the case of binary classification, while Softmax function is used in case of multi-classification.
Question - 69 : - What is meant by Parametric and Non-parametric Models?
Answer - 69 : -
Parametric models refer to the models having a limited number of parameters. In case of parametric models, only the parameter of a model is needed to be known to make predictions regarding the new data.
Non-parametric models do not have any restrictions on the number of parameters, which makes new data predictions more flexible. In case of non-parametric models, the knowledge of model parameters and the state of the data needs to be known to make predictions.
Question - 70 : - What are the Various Kernels that are present in SVM?
Answer - 70 : -
The various kernels that are present in SVM are:
- Linear
- Polynomial
- Radial Basis
- Sigmoid