TGViewer
Machine Learning & Artificial Intelligence | Data Science Free Courses Machine Learning & Artificial Intelligence | Data Science Free Courses @datasciencefree · 68.6K subscribers
Post #1620 2.29K
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
  • ❤ 2
More from @datasciencefree
  1. Sep 27, 2026Machine Learning Roadmap | |-- Fundamentals | |-- Mathematics | | |-- Linear Algebra | | |…
  2. Sep 24, 2026🚀 𝐁𝐞𝐜𝐨𝐦𝐞 𝐚𝐧 𝐀𝐈 𝐄𝐧𝐠𝐢𝐧𝐞𝐞𝐫 𝐢𝐧 𝟐𝟎𝟐𝟔 🎯 Choose Your Learning Track: 💻…
  3. Sep 23, 2026Machine Learning Roadmap
  4. Sep 23, 2026SQL & Python Cheatsheet for Beginners ❤️
  5. Sep 22, 2026#Ad #AI_Models 🔥 GigaChat 3.5 Reasoning [Open-Source] ℹ️ Overview: New LLM that thinks be…
  6. Sep 22, 2026✅ Programming Languages, Libraries & Tools Every Tech Field Uses 👨‍💻🚀 🧠 DATA SCIENCE &…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →