What is max_depth in Random Forest?

Updated May 17, 2026

Short answer

max_depth controls how deep each tree can grow.

Deep explanation

Limiting depth prevents trees from learning noise and helps generalization.

Real-world example

Used in banking models to avoid over-complex credit rules.

Common mistakes

  • Setting unlimited depth causing overfitting.

Follow-up questions

  • What happens if depth is too low?
  • Does Random Forest need pruning?

More Random Forest interview questions

View all →