SlideShare a Scribd company logo
1 of 20
Boosting 알고리즘
1. Bagging vs Boosting
2. AdaBoost
3. GBDT
4. XGBoost
5. LightGBM
1. Bagging vs Boosting
앙상블 기법의 종류 : 여러 개의 모델 결과를 합쳐 사용
Variance Bias
2. AdaBoost
가장 기초적인 부스팅 알고리즘
1) 이전 모델의 Error를 기반으로 weight를 계산
2) Exponential Loss function을 이용해 Update
2. AdaBoost
1) Error 계산
2) 가중치 계산
3) Exponential Loss Fucntion을 통해 Update
Y : 실제 결과
h : 예측 결과
W_t : t번째 분류기 가중치
- 단점
높은 weight 존재 시
성능이 크게 떨어짐 , 이상치에 약함
3. Gradient Boosting Decision Tree
Gradient descent가 크게 일어나는 지점으로 탐색
3. Gradient Boosting Decision Tree
특징
1) 실제값 – 예측값 = h 라 하고 h와 유사한 Loss function을 가정
2) 이전까지 학습된 모델 F 에 대해 미분하면 기울기로 표현됨
음의 기울기가 0으로 수렴하도록 탐색
- 장점
좋은 성능, 다양한 Loss fucntion 지원
- 단점
과적합 위험, 느린 속도
Gradient descent가 크게 일어나는 지점으로 탐색
4. XGBoost : 병렬처리와 Tree 알고리즘을 이용해 속도개선
- CART (Classfication And Regression Trees)
1) CART 알고리즘 적용
4. XGBoost
일반적인 트리 CART
분류기준 Entropy, information gain Gini index
분류방식 Field별 값을 기준으로 분할 이진 트리
과적합방지 X O
Leaf Node 데이터 수 조절
최소 변화량 조절
장점 구현 용이 사후 가지치기 가능
Leaf 별 점수할당
단점 Category 속성이 많으면
Tree가 깊어짐,
분기할 Feature 선택에 필요한
계산량 많음
충분한 학습데이터 필요
적을 경우 과적합 유발
- CART (Classfication And Regression Trees)
1) CART 알고리즘 적용
4. XGBoost
𝑂𝑏𝑗 𝜃 = 𝐿𝑜𝑠𝑠 𝜃 + 𝜔(𝜃)
𝜔 𝜃 = 𝛾𝑇 +
1
2
𝛿
𝑗=1
𝑇
𝑤𝑗
2
𝜔 = 𝛾3 +
1
2
𝛿(4 + 0.01 + 1)
- Regularization : L1 , L2 식을 통한 과적합방지
2) 함수에 정규화 식 추가로 과적합 방지
4. XGBoost
- 다양한 Loss function : Taylor 급수를 이용해 다양한 옵션 제공
4) 다양한 Loss function 지원
4. XGBoost
- 주요 Parameter 소개 (Python , Scikit-learn)
+ 파라미터 조절에 따른 불균형데이터 성능 변화
1. General Parameter : 모양
- booster : 모델의 종류 (default = gbtree)
- nthread : 코어 수
- num_feature : feature 수
2. Booster Parameter :
- min_child_weight
: 관측치들 가중치 합의 최소값 (default = 1) -> 1로 고정
- max_delta_step (default = 0)
: 로지스틱에서는 불균형 처리에 도움이 됨 (1~ 10 해보기, 0~inf)
- scale_pos_weight (default = 1)
: sum(negative instances) / sum(positive instances)
- eta : 학습률 (default = 0.3)
- gamma : loss function에서 분할하는데 필요한 최소 reduction (default = 0)
- max_depth : 트리의 최대 크기 (default = 6)
- max_leaf_nodes : 2^max_depth
- lambda : L2 regularization
- alpha (L1 regularization)
3. Learning Task Parameter
- objective : loss function (default = reg:linear)
- eval_metric
5. LightGBM
1. Data 수 감소
- GOSS(Gradient-based One-Side Sampling)
: Tree의 information gain 계산 전 데이터의 일부를 선별
2. Feature 묶음
- EFM(Exclusive Feature Bundling)
: Graph Coloring , 히스토그램 기반 알고리즘을 이용해
split point 정확도를 적게 훼손하며 변수 개수를 효과적으로 감소
1) 어떤 feature들을 묶을 것인가? / What?
2) 그럼 어떻게 묶을 것인지? / How?
: 계산할 Data, Feature수를 줄이자
5. LightGBM
1. GOSS(Gradient-based One-Side Sampling)
Information gain 계산 전 Gradient가 큰 data를 선별하자
- 알고리즘
1) gradient 절대값에 따라 data를 정렬하고 상위 a x 100% 선택 = topSet
2) 나머지 데이터에서 b x 100% 개체를 무작위 표본 추출 = randSet
3) information gain 계산 시 randSet을 1-a / b 만큼 증폭
-> 원 데이터 분포를 많이 바꾸지 않으면서 훈련이 덜 된 개체에 초점
5. LightGBM
1. GOSS(Gradient-based One-Side Sampling)
5. LightGBM
1) 어떤 feature들을 묶을 것인가? / What?
- Graph Coloring 문제로 정의
: NP-hard 다항시간 내에 solution을 찾을 수 없다
- 따라서, Greedy algorithm 적용
: 충돌, 꼭짓점 차수 기준으로
욕심쟁이 탐색
2. EFM(Exclusive Feature Bundling)
고 차원은 sparse 해서 0이 아닌 변수를 동시에 갖는 경우는 거의 없다
ex. One-Hot encoding
feature1 feature2
feature3
conflicts
0이 아닌 값들
5. LightGBM
1) 어떤 feature들을 묶을 것인가? / What?
a. edge마다 weight가 있는 그래프 구성
(weight = 변수 간 총 충돌 횟수 , 없으면 edge X)
b. 꼭지점 차수를 기준으로 내림차순 정렬
c. 작은 충돌(gamma로 제어)이 있는
기존 묶음에 할당하거나 새로운 묶음을 만들자
2. EFM(Exclusive Feature Bundling)
feature1 feature2
feature3
conflicts
0이 아닌 값들
5. LightGBM
2) 그럼 어떻게 묶을 것인지? / How?
- Histogram-based algorithm
: 정렬한 변수 값에서 분할점을 찾는 대신 연속적인 변수 값을 개별 구간으로
나누고 이 구간을 사용하여 split을 찾는다.
2. EFM(Exclusive Feature Bundling)
feature A : [0, 10] feature B : [0, 20]
feature B : [10, 30]
+ 10
feature A : [0, 10]
New_feature C = A + B
= [0, 30]
5. LightGBM
2) 그럼 어떻게 묶을 것인지? / How?
- Histogram-based algorithm 특징 2가지
2. EFM(Exclusive Feature Bundling)
Leaf-wise Growth Ignoring sparse inputs
- Readthedocs 튜닝가이드
1. For Faster Speed
- bagging_fraction , bagging_freq
- feature_fraction
- max_bin
- save_binary
: to speed up data loading in future learning
2. For Better Accuracy
- max_bin : Use large number
- learning_rate : small with large num_iter
- num_leaves
3. Deal with Over-fitting
- max_bin : small
- num_leaves : small
- lambda_l1 , lambda_l2 , min_gain_to_split
- max_depth : small (to avoid growing deep tree)
5. LightGBM
- Kaggle 추천 가이드
-num_leaves
: 2^(max_depth) 추천이나 80보다 큰 경우 더 아래로
-is_unbalance = True
-scale_pos_weight = True
이미지 출처
https://swalloow.github.io
https://www.researchgate.net/figure/Training-of-an-AdaBoost-
classifier-The-first-classifier-trains-on-unweighted-data-
then_fig3_306054843
https://hackernoon.com/gradient-descent-aynk-7cbe95a778da
https://www.kaggle.com/c/home-credit-default-risk/discussion/59806
https://www.microsoft.com/en-us/research/wp-
content/uploads/2017/11/lightgbm.pdf
http://mlexplained.com/2018/01/05/lightgbm-and-xgboost-explained/
https://xgboost.readthedocs.io/en/latest/parameter.html

More Related Content

What's hot

Hệ PhâN TáN
Hệ PhâN TáNHệ PhâN TáN
Hệ PhâN TáNit
 
Giáo trình SQL server tiếng việt
Giáo trình SQL server tiếng việtGiáo trình SQL server tiếng việt
Giáo trình SQL server tiếng việtThuyet Nguyen
 
B+Tree Indexes and InnoDB
B+Tree Indexes and InnoDBB+Tree Indexes and InnoDB
B+Tree Indexes and InnoDBOvais Tariq
 
Bài 2: Hệ điều hành và các ứng dụng mã nguồn mở
Bài 2: Hệ điều hành và các ứng dụng mã nguồn mởBài 2: Hệ điều hành và các ứng dụng mã nguồn mở
Bài 2: Hệ điều hành và các ứng dụng mã nguồn mởMasterCode.vn
 
Introduction of Xgboost
Introduction of XgboostIntroduction of Xgboost
Introduction of Xgboostmichiaki ito
 
Tổng quan về cơ sở dữ liệu
Tổng quan về cơ sở dữ liệuTổng quan về cơ sở dữ liệu
Tổng quan về cơ sở dữ liệuTonhaco Bestco
 
Reinforcement Learning in Practice: Contextual Bandits
Reinforcement Learning in Practice: Contextual BanditsReinforcement Learning in Practice: Contextual Bandits
Reinforcement Learning in Practice: Contextual BanditsMax Pagels
 
Bg chuong trinh dich chuong 3
Bg chuong trinh dich chuong 3Bg chuong trinh dich chuong 3
Bg chuong trinh dich chuong 3Trần Văn Nam
 
[Đồ án môn học] - Đề tài: Nghiên cứu xây dựng giải pháp thu thập và quản lý ...
[Đồ án môn học] - Đề tài: Nghiên cứu xây dựng giải pháp thu thập  và quản lý ...[Đồ án môn học] - Đề tài: Nghiên cứu xây dựng giải pháp thu thập  và quản lý ...
[Đồ án môn học] - Đề tài: Nghiên cứu xây dựng giải pháp thu thập và quản lý ...Ý Như Lê
 
Working with Deeply Nested Documents in Apache Solr: Presented by Anshum Gupt...
Working with Deeply Nested Documents in Apache Solr: Presented by Anshum Gupt...Working with Deeply Nested Documents in Apache Solr: Presented by Anshum Gupt...
Working with Deeply Nested Documents in Apache Solr: Presented by Anshum Gupt...Lucidworks
 
Bài 7: Thiết kế cơ sở dữ liệu vật lý
Bài 7: Thiết kế cơ sở dữ liệu vật lýBài 7: Thiết kế cơ sở dữ liệu vật lý
Bài 7: Thiết kế cơ sở dữ liệu vật lýMasterCode.vn
 

What's hot (20)

Hệ PhâN TáN
Hệ PhâN TáNHệ PhâN TáN
Hệ PhâN TáN
 
Sql server chuong 2 nkhanh
Sql server chuong 2 nkhanhSql server chuong 2 nkhanh
Sql server chuong 2 nkhanh
 
TinyBERT
TinyBERTTinyBERT
TinyBERT
 
Data Augmentation
Data AugmentationData Augmentation
Data Augmentation
 
Giáo trình SQL server tiếng việt
Giáo trình SQL server tiếng việtGiáo trình SQL server tiếng việt
Giáo trình SQL server tiếng việt
 
Kho 200 Đề Tài Luận Văn Tốt Nghiệp Ngành Sư Phạm Tin Học
Kho 200 Đề Tài Luận Văn Tốt Nghiệp Ngành Sư Phạm Tin HọcKho 200 Đề Tài Luận Văn Tốt Nghiệp Ngành Sư Phạm Tin Học
Kho 200 Đề Tài Luận Văn Tốt Nghiệp Ngành Sư Phạm Tin Học
 
B+Tree Indexes and InnoDB
B+Tree Indexes and InnoDBB+Tree Indexes and InnoDB
B+Tree Indexes and InnoDB
 
Bài 2: Hệ điều hành và các ứng dụng mã nguồn mở
Bài 2: Hệ điều hành và các ứng dụng mã nguồn mởBài 2: Hệ điều hành và các ứng dụng mã nguồn mở
Bài 2: Hệ điều hành và các ứng dụng mã nguồn mở
 
Introduction of Xgboost
Introduction of XgboostIntroduction of Xgboost
Introduction of Xgboost
 
HDH
HDHHDH
HDH
 
Bayesian Global Optimization
Bayesian Global OptimizationBayesian Global Optimization
Bayesian Global Optimization
 
Tổng quan về cơ sở dữ liệu
Tổng quan về cơ sở dữ liệuTổng quan về cơ sở dữ liệu
Tổng quan về cơ sở dữ liệu
 
Reinforcement Learning in Practice: Contextual Bandits
Reinforcement Learning in Practice: Contextual BanditsReinforcement Learning in Practice: Contextual Bandits
Reinforcement Learning in Practice: Contextual Bandits
 
Bg chuong trinh dich chuong 3
Bg chuong trinh dich chuong 3Bg chuong trinh dich chuong 3
Bg chuong trinh dich chuong 3
 
[Đồ án môn học] - Đề tài: Nghiên cứu xây dựng giải pháp thu thập và quản lý ...
[Đồ án môn học] - Đề tài: Nghiên cứu xây dựng giải pháp thu thập  và quản lý ...[Đồ án môn học] - Đề tài: Nghiên cứu xây dựng giải pháp thu thập  và quản lý ...
[Đồ án môn học] - Đề tài: Nghiên cứu xây dựng giải pháp thu thập và quản lý ...
 
Xếp hạng và tính toán song song trên nền tảng Apache Spark, HAY
Xếp hạng và tính toán song song trên nền tảng Apache Spark, HAYXếp hạng và tính toán song song trên nền tảng Apache Spark, HAY
Xếp hạng và tính toán song song trên nền tảng Apache Spark, HAY
 
Bai giang word 2010
Bai giang word 2010Bai giang word 2010
Bai giang word 2010
 
Working with Deeply Nested Documents in Apache Solr: Presented by Anshum Gupt...
Working with Deeply Nested Documents in Apache Solr: Presented by Anshum Gupt...Working with Deeply Nested Documents in Apache Solr: Presented by Anshum Gupt...
Working with Deeply Nested Documents in Apache Solr: Presented by Anshum Gupt...
 
Bài 7: Thiết kế cơ sở dữ liệu vật lý
Bài 7: Thiết kế cơ sở dữ liệu vật lýBài 7: Thiết kế cơ sở dữ liệu vật lý
Bài 7: Thiết kế cơ sở dữ liệu vật lý
 
Nosql databases
Nosql databasesNosql databases
Nosql databases
 

Similar to Boosting_suman

Lightgbm_suman
Lightgbm_sumanLightgbm_suman
Lightgbm_sumansuman_lim
 
Machine learning boosting 20180424
Machine learning boosting 20180424Machine learning boosting 20180424
Machine learning boosting 20180424Changwook Jun
 
Coursera Machine Learning (by Andrew Ng)_강의정리
Coursera Machine Learning (by Andrew Ng)_강의정리Coursera Machine Learning (by Andrew Ng)_강의정리
Coursera Machine Learning (by Andrew Ng)_강의정리SANG WON PARK
 
Ml for 정형데이터
Ml for 정형데이터Ml for 정형데이터
Ml for 정형데이터JEEHYUN PAIK
 
[홍대 머신러닝 스터디 - 핸즈온 머신러닝] 4장. 모델 훈련
[홍대 머신러닝 스터디 - 핸즈온 머신러닝] 4장. 모델 훈련[홍대 머신러닝 스터디 - 핸즈온 머신러닝] 4장. 모델 훈련
[홍대 머신러닝 스터디 - 핸즈온 머신러닝] 4장. 모델 훈련Haesun Park
 
Deferred Shading
Deferred ShadingDeferred Shading
Deferred Shading종빈 오
 
Bag of Tricks for Image Classification with Convolutional Neural Networks (C...
Bag of Tricks for Image Classification  with Convolutional Neural Networks (C...Bag of Tricks for Image Classification  with Convolutional Neural Networks (C...
Bag of Tricks for Image Classification with Convolutional Neural Networks (C...gohyunwoong
 
Titanic kaggle competition
Titanic kaggle competitionTitanic kaggle competition
Titanic kaggle competitionjdo
 
Graph convolutional matrix completion
Graph convolutional  matrix completionGraph convolutional  matrix completion
Graph convolutional matrix completionpko89403
 
Policy gradient
Policy gradientPolicy gradient
Policy gradient태영 정
 
Chapter 8 - optimization for training deep models
Chapter 8 - optimization for training deep modelsChapter 8 - optimization for training deep models
Chapter 8 - optimization for training deep modelsKyeongUkJang
 
KOOC Ch8. k-means & GMM
KOOC Ch8. k-means & GMMKOOC Ch8. k-means & GMM
KOOC Ch8. k-means & GMMsuman_lim
 
[신경망기초] 소프트맥스회귀분석
[신경망기초] 소프트맥스회귀분석[신경망기초] 소프트맥스회귀분석
[신경망기초] 소프트맥스회귀분석jaypi Ko
 
생체 광학 데이터 분석 AI 경진대회 7위 수상작
생체 광학 데이터 분석 AI 경진대회 7위 수상작생체 광학 데이터 분석 AI 경진대회 7위 수상작
생체 광학 데이터 분석 AI 경진대회 7위 수상작DACON AI 데이콘
 
2.supervised learning(epoch#2)-1
2.supervised learning(epoch#2)-12.supervised learning(epoch#2)-1
2.supervised learning(epoch#2)-1Haesun Park
 
4.representing data and engineering features(epoch#2)
4.representing data and engineering features(epoch#2)4.representing data and engineering features(epoch#2)
4.representing data and engineering features(epoch#2)Haesun Park
 

Similar to Boosting_suman (17)

Lightgbm_suman
Lightgbm_sumanLightgbm_suman
Lightgbm_suman
 
Machine learning boosting 20180424
Machine learning boosting 20180424Machine learning boosting 20180424
Machine learning boosting 20180424
 
Coursera Machine Learning (by Andrew Ng)_강의정리
Coursera Machine Learning (by Andrew Ng)_강의정리Coursera Machine Learning (by Andrew Ng)_강의정리
Coursera Machine Learning (by Andrew Ng)_강의정리
 
Ml for 정형데이터
Ml for 정형데이터Ml for 정형데이터
Ml for 정형데이터
 
[홍대 머신러닝 스터디 - 핸즈온 머신러닝] 4장. 모델 훈련
[홍대 머신러닝 스터디 - 핸즈온 머신러닝] 4장. 모델 훈련[홍대 머신러닝 스터디 - 핸즈온 머신러닝] 4장. 모델 훈련
[홍대 머신러닝 스터디 - 핸즈온 머신러닝] 4장. 모델 훈련
 
Deferred Shading
Deferred ShadingDeferred Shading
Deferred Shading
 
Bag of Tricks for Image Classification with Convolutional Neural Networks (C...
Bag of Tricks for Image Classification  with Convolutional Neural Networks (C...Bag of Tricks for Image Classification  with Convolutional Neural Networks (C...
Bag of Tricks for Image Classification with Convolutional Neural Networks (C...
 
Titanic kaggle competition
Titanic kaggle competitionTitanic kaggle competition
Titanic kaggle competition
 
Xai week3
Xai week3Xai week3
Xai week3
 
Graph convolutional matrix completion
Graph convolutional  matrix completionGraph convolutional  matrix completion
Graph convolutional matrix completion
 
Policy gradient
Policy gradientPolicy gradient
Policy gradient
 
Chapter 8 - optimization for training deep models
Chapter 8 - optimization for training deep modelsChapter 8 - optimization for training deep models
Chapter 8 - optimization for training deep models
 
KOOC Ch8. k-means & GMM
KOOC Ch8. k-means & GMMKOOC Ch8. k-means & GMM
KOOC Ch8. k-means & GMM
 
[신경망기초] 소프트맥스회귀분석
[신경망기초] 소프트맥스회귀분석[신경망기초] 소프트맥스회귀분석
[신경망기초] 소프트맥스회귀분석
 
생체 광학 데이터 분석 AI 경진대회 7위 수상작
생체 광학 데이터 분석 AI 경진대회 7위 수상작생체 광학 데이터 분석 AI 경진대회 7위 수상작
생체 광학 데이터 분석 AI 경진대회 7위 수상작
 
2.supervised learning(epoch#2)-1
2.supervised learning(epoch#2)-12.supervised learning(epoch#2)-1
2.supervised learning(epoch#2)-1
 
4.representing data and engineering features(epoch#2)
4.representing data and engineering features(epoch#2)4.representing data and engineering features(epoch#2)
4.representing data and engineering features(epoch#2)
 

Boosting_suman

  • 1. Boosting 알고리즘 1. Bagging vs Boosting 2. AdaBoost 3. GBDT 4. XGBoost 5. LightGBM
  • 2. 1. Bagging vs Boosting 앙상블 기법의 종류 : 여러 개의 모델 결과를 합쳐 사용 Variance Bias
  • 3. 2. AdaBoost 가장 기초적인 부스팅 알고리즘 1) 이전 모델의 Error를 기반으로 weight를 계산 2) Exponential Loss function을 이용해 Update
  • 4. 2. AdaBoost 1) Error 계산 2) 가중치 계산 3) Exponential Loss Fucntion을 통해 Update Y : 실제 결과 h : 예측 결과 W_t : t번째 분류기 가중치 - 단점 높은 weight 존재 시 성능이 크게 떨어짐 , 이상치에 약함
  • 5. 3. Gradient Boosting Decision Tree Gradient descent가 크게 일어나는 지점으로 탐색
  • 6. 3. Gradient Boosting Decision Tree 특징 1) 실제값 – 예측값 = h 라 하고 h와 유사한 Loss function을 가정 2) 이전까지 학습된 모델 F 에 대해 미분하면 기울기로 표현됨 음의 기울기가 0으로 수렴하도록 탐색 - 장점 좋은 성능, 다양한 Loss fucntion 지원 - 단점 과적합 위험, 느린 속도 Gradient descent가 크게 일어나는 지점으로 탐색
  • 7. 4. XGBoost : 병렬처리와 Tree 알고리즘을 이용해 속도개선 - CART (Classfication And Regression Trees) 1) CART 알고리즘 적용
  • 8. 4. XGBoost 일반적인 트리 CART 분류기준 Entropy, information gain Gini index 분류방식 Field별 값을 기준으로 분할 이진 트리 과적합방지 X O Leaf Node 데이터 수 조절 최소 변화량 조절 장점 구현 용이 사후 가지치기 가능 Leaf 별 점수할당 단점 Category 속성이 많으면 Tree가 깊어짐, 분기할 Feature 선택에 필요한 계산량 많음 충분한 학습데이터 필요 적을 경우 과적합 유발 - CART (Classfication And Regression Trees) 1) CART 알고리즘 적용
  • 9. 4. XGBoost 𝑂𝑏𝑗 𝜃 = 𝐿𝑜𝑠𝑠 𝜃 + 𝜔(𝜃) 𝜔 𝜃 = 𝛾𝑇 + 1 2 𝛿 𝑗=1 𝑇 𝑤𝑗 2 𝜔 = 𝛾3 + 1 2 𝛿(4 + 0.01 + 1) - Regularization : L1 , L2 식을 통한 과적합방지 2) 함수에 정규화 식 추가로 과적합 방지
  • 10. 4. XGBoost - 다양한 Loss function : Taylor 급수를 이용해 다양한 옵션 제공 4) 다양한 Loss function 지원
  • 11. 4. XGBoost - 주요 Parameter 소개 (Python , Scikit-learn) + 파라미터 조절에 따른 불균형데이터 성능 변화 1. General Parameter : 모양 - booster : 모델의 종류 (default = gbtree) - nthread : 코어 수 - num_feature : feature 수 2. Booster Parameter : - min_child_weight : 관측치들 가중치 합의 최소값 (default = 1) -> 1로 고정 - max_delta_step (default = 0) : 로지스틱에서는 불균형 처리에 도움이 됨 (1~ 10 해보기, 0~inf) - scale_pos_weight (default = 1) : sum(negative instances) / sum(positive instances) - eta : 학습률 (default = 0.3) - gamma : loss function에서 분할하는데 필요한 최소 reduction (default = 0) - max_depth : 트리의 최대 크기 (default = 6) - max_leaf_nodes : 2^max_depth - lambda : L2 regularization - alpha (L1 regularization) 3. Learning Task Parameter - objective : loss function (default = reg:linear) - eval_metric
  • 12. 5. LightGBM 1. Data 수 감소 - GOSS(Gradient-based One-Side Sampling) : Tree의 information gain 계산 전 데이터의 일부를 선별 2. Feature 묶음 - EFM(Exclusive Feature Bundling) : Graph Coloring , 히스토그램 기반 알고리즘을 이용해 split point 정확도를 적게 훼손하며 변수 개수를 효과적으로 감소 1) 어떤 feature들을 묶을 것인가? / What? 2) 그럼 어떻게 묶을 것인지? / How? : 계산할 Data, Feature수를 줄이자
  • 13. 5. LightGBM 1. GOSS(Gradient-based One-Side Sampling) Information gain 계산 전 Gradient가 큰 data를 선별하자 - 알고리즘 1) gradient 절대값에 따라 data를 정렬하고 상위 a x 100% 선택 = topSet 2) 나머지 데이터에서 b x 100% 개체를 무작위 표본 추출 = randSet 3) information gain 계산 시 randSet을 1-a / b 만큼 증폭 -> 원 데이터 분포를 많이 바꾸지 않으면서 훈련이 덜 된 개체에 초점
  • 15. 5. LightGBM 1) 어떤 feature들을 묶을 것인가? / What? - Graph Coloring 문제로 정의 : NP-hard 다항시간 내에 solution을 찾을 수 없다 - 따라서, Greedy algorithm 적용 : 충돌, 꼭짓점 차수 기준으로 욕심쟁이 탐색 2. EFM(Exclusive Feature Bundling) 고 차원은 sparse 해서 0이 아닌 변수를 동시에 갖는 경우는 거의 없다 ex. One-Hot encoding feature1 feature2 feature3 conflicts 0이 아닌 값들
  • 16. 5. LightGBM 1) 어떤 feature들을 묶을 것인가? / What? a. edge마다 weight가 있는 그래프 구성 (weight = 변수 간 총 충돌 횟수 , 없으면 edge X) b. 꼭지점 차수를 기준으로 내림차순 정렬 c. 작은 충돌(gamma로 제어)이 있는 기존 묶음에 할당하거나 새로운 묶음을 만들자 2. EFM(Exclusive Feature Bundling) feature1 feature2 feature3 conflicts 0이 아닌 값들
  • 17. 5. LightGBM 2) 그럼 어떻게 묶을 것인지? / How? - Histogram-based algorithm : 정렬한 변수 값에서 분할점을 찾는 대신 연속적인 변수 값을 개별 구간으로 나누고 이 구간을 사용하여 split을 찾는다. 2. EFM(Exclusive Feature Bundling) feature A : [0, 10] feature B : [0, 20] feature B : [10, 30] + 10 feature A : [0, 10] New_feature C = A + B = [0, 30]
  • 18. 5. LightGBM 2) 그럼 어떻게 묶을 것인지? / How? - Histogram-based algorithm 특징 2가지 2. EFM(Exclusive Feature Bundling) Leaf-wise Growth Ignoring sparse inputs
  • 19. - Readthedocs 튜닝가이드 1. For Faster Speed - bagging_fraction , bagging_freq - feature_fraction - max_bin - save_binary : to speed up data loading in future learning 2. For Better Accuracy - max_bin : Use large number - learning_rate : small with large num_iter - num_leaves 3. Deal with Over-fitting - max_bin : small - num_leaves : small - lambda_l1 , lambda_l2 , min_gain_to_split - max_depth : small (to avoid growing deep tree) 5. LightGBM - Kaggle 추천 가이드 -num_leaves : 2^(max_depth) 추천이나 80보다 큰 경우 더 아래로 -is_unbalance = True -scale_pos_weight = True

Editor's Notes

  1. 이상치에 약하다, 단순 오차만 고려해 정답값을 찾아 속도가 느리다./ 이상치 데이터, 일반데이터 성능비교