목록Machine Learning (45)
Allen's 데이터 맛집
GridSearchCV란? GridSearchCV는 머신러닝에서 모델의 성능을 향상하기 위한 하이퍼파라미터 튜닝을 도와주는 도구입니다. 하이퍼파라미터는 모델 학습 과정을 제어하는 값으로, 제대로 설정하지 않으면 모델의 성능이 좋지 않을 수 있어요. 그래서 GridSearchCV는 여러 가지 하이퍼파라미터 조합을 시도해 보면서 최적의 조합을 찾아줍니다. 유명한 Iris(붓꽃)데이터를 가지고 GridSearchCV를 사용하여 최적의 하이퍼파라미터를 찾을 수 있습니다. from sklearn.model_selection import GridSearchCV from sklearn.svm import SVC from sklearn.datasets import load_iris # 데이터 불러오기 iris = lo..
파라미터란? 파라미터는 모델 자체가 데이터를 학습하면서 조정하는 '가중치' 같은 것이라고 생각하시면 됩니다. 예를 들어, 선형 회귀 모델에서 직선의 기울기와 절편이 파라미터입니다. 모델의 구성요소이며 데이터로부터 학습되는 것입니다. Linear Regression에서 y = Wx + b와 같은 직선 방정식의 W, b를 찾는 것 하이퍼 파라미터란? 반면에 하이퍼파라미터는 모델 학습 전에 수동으로 설정해야 하는 조절용 값으로, 모델의 학습 방식을 조정하는 역할을 합니다. 예를 들어, 신경망에서 학습률이나 은닉층의 개수 같은 값들이 하이퍼파라미터입니다. kNN에서 k의 개수, Ridge, Lasso의 α값, Learning Rate 등
오버피팅이란? 오버피팅은 모델이 훈련 데이터에 너무 맞춰져서 실제 데이터에서는 성능이 떨어지는 현상을 의미합니다. 마치 시험을 외우는 것과 비슷하죠. 중요한 것은 모델이 데이터 패턴을 너무 따라 하면서 유연성을 잃는 것을 방지하는 방법들을 알아보는 것입니다. 머신러닝 진행 시 주의해야되는 가장 중요한 문제 중 하나로써 아래의 강아지 집처럼 너무 잘 맞아떨어진다는 것입니다 해결 방법 방법으로는 아래의 방법들이 있습니다 - Cross Validation - Regularization - Remove Features - Ensembling
교차 검증은 모델의 성능을 더 정확하게 평가하기 위해 데이터를 여러 개의 폴드(fold)로 나누어 각각을 테스트 세트로 사용하고 나머지를 훈련 세트로 사용하는 방법입니다. 이를 통해 모델의 성능을 더 일반화된 방식으로 평가할 수 있습니다. 데이터가 충분하지 않을 경우 이전 포스팅의 Hold-out으로 나누면 많은 양의 분산 발생합니다. 이에 대한 해결책으로 교차검증을 사용할 수 있으나 클래스 불균형 데이터에는 적합하지 않습니다. https://allensdatablog.tistory.com/entry/%ED%99%80%EB%93%9C-%EC%95%84%EC%9B%83Hold-out%EC%9D%B4%EB%9E%80 홀드 아웃(Hold out)이란? 홀드아웃 이란? 홀드아웃 기법은 기계 학습 모델을 평가하기..