ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [30 Days of ML] Day 10
    Program/[Kaggle] 30 Days of ML 2021. 8. 15. 19:34
    반응형

    Tutorials


    Experimenting With Different Models

    decision tree model에는 많은 옵션이 있다. 가장 중요한 옵션은 tree's depth이다. tree's depth는 예측에 도달하기 전에 얼마나 많은 분할을 수행하는지에 대한 척도이다. 아래의 경우 비교적 얕은 깊이이다.

    Depth 2 Tree

    overfitting 많은 잎으로 집을 나누는 경우 각 잎에 더 적은 집을 가지게 된다. 주택이 적은 잎은 주택의 실제 값에 상당히 가까운 예측을 하지만 새로운 데이터에 대해 신뢰할 수 없는 예측을 하게 된다. (각 예측이 적은 주택에 기반하기 때문임) 과적합은 훈련 데이터에 거의 완벽히 일치하지만 검증 및 새로운 데이터에 대해서는 제대로 예측이 되지 않는다.

    underfitting 결정 트리의 깊이가 적은 경우 각 잎은 다양한 집을 가지게 된다. 훈련 데이터에서도 대부분 주택 예측이 틀릴 수 있다. 모델이 데이터에서 중요한 차이점과 패턴을 포착하지 못해 학습 데이터에서도 성능이 저하되는 경우를 과소적합이라고 한다.

    underfitting_overfitting


    Example

    트리 깊이를 제어하기 위한 몇 가지 대안이 있으며 대부분은 트리를 통과하는 일부 경로가 다른 경로보다 더 깊은 깊이를 가질 수 있다. 그러나 max_leaf_nodes는 과적합 및 과소적합을 제어하는 합리적 방법을 제공한다. 모델이 만들도록 허용하는 잎이 많을수록 위 그래프의 과소적합 영역에서 과적합 영역으로 이동하게 된다.
    (There are a few alternatives for controlling the tree depth, and many allow for some routes through the tree to have greater depth than other routes. But the max_leaf_nodes argument provides a very sensible way to control overfitting vs underfitting. The more leaves we allow the model to make, the more we move from the underfitting area in the above graph to the overfitting area.)

    • Overfitting: capturing spurious patterns that won't recur in the future, leading to less accurate predictions, or
    • Underfitting: failing to capture relevant patterns, again leading to less accurate predictions.

    Introduction

    random forest는 많은 트리를 사용해 각 구성 요소 트리의 예측을 평균하여 예측한다. 일반적으로 단일 의사 결정 트리보다 더 나은 예측 정확도를 가지며 기본 매개변수와 잘 작동한다.

    반응형

    'Program > [Kaggle] 30 Days of ML' 카테고리의 다른 글

    [30 Days of ML] Day 9 - part 2  (0) 2021.08.15
    [30 Days of ML] Day 9 - part 1  (0) 2021.08.15
    [30 Days of ML] Day 8  (0) 2021.08.12
    [30 Days of ML] Day 7  (0) 2021.08.12
    [30 Days of ML] Day 6  (0) 2021.08.11

    댓글

Designed by Tistory.