bagging 레시피
Random forest가 bootstrap sample 위에 많은 decision tree 키움, 각 tree가 random feature subset 위에서 split. prediction은 평균(regression)이나 vote(classification). bagging이 variance 극적으로 낮추면서 bias는 단일 tree와 거의 같게 유지. random feature subsetting이 tree들을 decorrelate해서 variance 감소가 진짜.
튜닝할 것 (그리고 안 할 것)
- n_estimators — 보통 더 많을수록 더 좋음, 컴퓨트 다할 때까지. 몇 백 넘으면 diminishing return.
- max_features — classification은 sqrt, regression은 1/3이 sane default.
- max_depth, min_samples_leaf — 개별 tree 복잡도 control. default가 놀랍게 자주 잘 동작.
- Out-of-bag (OOB) score — generalization 무료 추정.
oob_score=True로 켜.
언제 reach
Random forest가 logistic regression 위 "그냥 동작하는" tabular baseline. 최소 튜닝으로 강한 out-of-the-box performance 원하고 약간 큰 메모리 견딜 수 있을 때 사용. leaderboard 정상엔 gradient boosting이 보통 살짝 이김.