juooo1117

[Module 4] Supervised Learning: Ensemble 본문

Artificial Intelligence/LG Aimers: AI전문가과정

[Module 4] Supervised Learning: Ensemble

Hyo__ni 2024. 1. 11. 23:03

Part 6. Ensemble Learning

앙상블 방식: 머신러닝에서 알고리즘의 종류에 상관 없이 서로 다르거나, 같은 매커니즘으로 동작하는 다양한 머신러닝 모델을 묶어서 함께 사용하는 방식

→ 여러 다른 model을 함께 모아서 예측 model의 집합으로 사용하는 것이다.

 

Ensemble Methods

Basic idea: Build different experts, and let them vote

Predic class label for unseen data by aggregating a set of predictions : different classifiers (experts) learned from the training data.

Make a decision with a voting.

 → 학습 데이터셋을 랜덤하게 나누어서 학습을 진행한다. 같은 학습데이터로 학습하는 것을 지양해야함. 최종결정은 학습된 다수의 모델이 각각 결정을 내린 후에 다수결로 최종 예측결과를 제공한다.

 

Advantages:

  -  Improve predictive performance (예측 성능을 안정적으로 향상시킴)

  -  Other types of classifiers can be directly included

  -  Easy to implement

  -  Not too much parameter tuning (독립적으로 학습되기 때문에 모델 파라미터의 튜닝이 많이 필요없음)

 

Disadvantage:

  -  Not a compact representation (다양한 모델을 혼합해서 사용하기 때문에 표현이 어려움)

 

 

Bagging

: Bootstrapping + Aggregating (for more robust performance lower variance)

학습 과정에서 training sample을 랜덤하게 나누어 선택해서 학습한다. (Training samples are randomly chosen)

다양한 sample들로 학습을 하기 때문에, 같은 모델이더라도 다른 특성을 가지는 학습이 가능하게 된다.

 

Bagging works because it reduces variance by voting/averaging (robust to overfitting)

 

Boosting

: sequential 하게 동작한다.

다음 classifers 를 학습할 때 이전의 결과(어떤 샘플이 중요하고, 중요하지 않은지를 weight 를 통해 나타낸 것)를 사용하는 구조이다. 

Cascading of weak classifiers - train multiple models in sequence

weak classifier : bias가 높아서, 모델이 단순하므로 성능이 낮다.

Adaboost

: 대표적인 boosting 알고리즘으로, base classifier에 의해서 오분류된 sample에 대해서 보다 높은 가중치를 두어서 다음 학습에 사용할 수 있도록 한다.

Advantage

  -  Simple and easy to implement

  -  Flexible : can combine with any learning algorithm (특정한 학습 알고리즘에 구애받지 않음)

  -  No prior knowledge needed about weak learner

  -  Versatile : can be applied on a wide variety of problems

  -  Non-parametric

 

Improving decision tree,

Bagging random forest 에 사용

Boosting gradient boosting machine (GBM) as generalized Adaboost (성능 높이는 것으로 매우 유명한 ml algorithm)

 

 

Performance Evaluation in Supervised Learning

Confusion matrix: 각 경우에 대해서 오차가 얼마나 있었는지를 표현하는 방법 (대각성분에 있는 값이 분류를 정확하게 수행한 값을 나타낸다.)

 → Accuracy : 대각 성분을 합한 값을 전체 성분으로 나눈 값!

 

ROC Curve

서로 다른 classifier의 성능을 측정하는데 사용하는 curve 이다.

Performance comparisons between different classifiers in different true positive rates (TPR; recall or sensitivity) and true negative rates (TNR; specificity).

*왼쪽 상단으로 그래프가 갈수록 성능이 좋은 curve를 의미한다. (동일 sensitivity에서 더 낮은 FPR을 제공하기 때문)

False Positive Ratio: 실제 Negative 중 잘못 분류한 비율