Data Science Interview Questions with Answers
What’s the difference between random forest and gradient boosting?
Random Forests builds each tree independently while Gradient Boosting builds one tree at a time.
Random Forests combine results at the end of the process (by averaging or "majority rules") while Gradient Boosting combines results along the way.
What happens to our linear regression model if we have three columns in our data: x, y, z — and z is a sum of x and y?
We would not be able to perform the regression. Because z is linearly dependent on x and y so when performing the regression would be a singular (not invertible) matrix.
Which regularization techniques do you know?
There are mainly two types of regularization,
L1 Regularization (Lasso regularization) - Adds the sum of absolute values of the coefficients to the cost function.
L2 Regularization (Ridge regularization) - Adds the sum of squares of coefficients to the cost function
Here, Lambda determines the amount of regularization.
How does L2 regularization look like in a linear model?
L2 regularization adds a penalty term to our cost function which is equal to the sum of squares of models coefficients multiplied by a lambda hyperparameter.
This technique makes sure that the coefficients are close to zero and is widely used in cases when we have a lot of features that might correlate with each other.
What are the main parameters in the gradient boosting model?
There are many parameters, but below are a few key defaults.
learning_rate=0.1 (shrinkage).
n_estimators=100 (number of trees).
max_depth=3.
min_samples_split=2.
min_samples_leaf=1.
subsample=1.0.
Data Science Resources: https://whatsapp.com/channel/0029Va8v3eo1NCrQfGMseL2D
Post #615
739
- ❤ 2