본문 바로가기
728x90
반응형

Decision tree7

Double Descent: new approach of bias-variance trade-off Double Descent: Modern approach of bias-variance trade-off classic ML의 관점에서, bias-variance trade-off는 model complexity와 관련있다. 이전 포스트를 참고해도 좋다. https://trivia-starage.tistory.com/238 Overfitting을 막는 방법들 (regularization, cross-validation, early stopping) Overfitting and Regularization ※ The blog post is based on lecture materials from Xavier Bresson, a professor at the National University of Singa.. 2024. 3. 3.
[CS246] Gradient Boosted Decision Trees (GBDT) Gradient Boosted Decision Tree: Additive Learning Example: Regression 다음과 같은 데이터에 대하여 regression task를 생각해보자. \[ D = \{ (10, -10),\ (20, 7),\ (25,8),\ (35,-7) \} \] 상수를 예측하는 것부터 시작하다. 여기서 $\hat{y}_i^{(0)}=0.5$라 하자. $y$: groud truth vector $y_i$는 $i$번째 instance(data point)의 ground truth이다. $\hat{y}^{(t)}$: $t$번째 round에서 예측한 predicted value vector $\hat{y}_i^{(t)}$는 $t$번째 round에서 예측한 $i$번째 instanc.. 2023. 12. 4.
[Data Science] Decision Tree in Python (with Scikit-learn) Decision Tree in Scikit learn 사이킷런 공식 문서에 따르면, 사이킷런의 Decision Tree는 CART 알고리즘을 바탕으로 최적화되어 구현되어있다. 그러나 categorical variable을 더이상 지원하지 않는다. https://scikit-learn.org/stable/modules/tree.html#tree-algorithms-id3-c4-5-c5-0-and-cart Decision Tree Tutorial with Iris dataset 사이킷런의 붓꽃 데이터셋을 이용하여 간단하게 decision tree를 학습해보자. load dataset and fit the classifier from sklearn.datasets import load_iris from skl.. 2023. 5. 1.
[Data Science] Decision Tree - Overfitting Overfitting and Underfitting Overfitting (과적합, 과대적합) 과적합은 모델이 학습 데이터에 대해 너무 잘 학습되어 기본 패턴 대신 데이터의 노이즈에 맞추기 시작할 때 발생한다. 학습 데이터에 지나치게 맞추면(overfit) 이후 새로운 데이터(new, unseen data)에 대하여 일반화를 하지 못할 수 있다. Underfitting (과소적합) 과소 적합은 모델이 너무 단순하여 데이터의 기본 패턴을 포착할 수 없을 때 발생한다. 이는 모델이 학습 데이터와 테스트 데이터 모두에서 제대로 작동하지 않는다는 것을 의미한다. 즉, 모델이 학습 데이터에서 보이지 않는 새로운 데이터(new, unseen data)를 정확하게 예측할 수 있을 만큼 충분히 학습하지 못했다는 뜻입니.. 2023. 4. 29.
[Data Science] Decision Tree - Information Gain, Gain Ratio Entropy 이전 포스팅에서 엔트로피에 대해 간단히 다뤄보았다. 이제 엔트로피를 이용한 정보획득(information gain, IG)을 이용한 decision tree를 살펴보자. https://trivia-starage.tistory.com/106?category=1047124 Entropy의 의미 (정보이론) Entropy in information theory 정의 정보이론에서, 확률변수의 엔트로피는 변수의 불확실성의 기댓값이다. $\mathcal{X}$에서 추출한 (이산)확률변수 $X$의 엔트로피를 $H(X)$라 하고 아래와 같다. \[ H(X) = -\sum trivia-starage.tistory.com \[ Entropy = -\sum_{i}p_i \log_2{p_i} \] Note: 이.. 2023. 4. 29.
[Data Science] Decision Tree in R iris dataset과 rpart를 이용한 예제이다. iris 데이터의 70%를 이용하여 decision tree를 학습하고 나머지 30%로 test한다. rm(list=ls()) library(rpart) library(rattle) library(caret) getAccF1 2023. 4. 28.
728x90
반응형