[Data Science] Classification - Random Forest

Random Forest

  • Decision tree는 하나지만 random forest는 나무가 최소 500개 이상이다. 나무 혼자 뭘 할 수 있는데.
  • 아무튼 많은 수의 decision tree를 사용하여 성능이 좋은 다수의 decision tree의 특징을 모아 최종적인 decision tree를 만들어내는 기법이다.

Algorithm

1. Bootstrap sample (*Bootstrap: 유사 데이터 여러 개 만들어내는 기법): 데이터 중복되어도 괜찮고, 순서 섞여도 문제 없다. 오히려 좋아.

Bootstraping samples

2. 무작위 feature set에 대해 tree를 생성한다. 진짜 많이.

So many trees

3. Aggregation: majority voting을 사용하여 여러 모델에서 classification을 잘하는 feature를 찾아 새로운 decision tree를 만든다.

Majority voting

근데? 더 성능을 높이고 싶다면 accuracy를 weight로 넣으면 된다.

Weighted majority voting