목록Machine Learning/머신러닝 (44)
Allen's 데이터 맛집
파라미터란? 파라미터는 모델 자체가 데이터를 학습하면서 조정하는 '가중치' 같은 것이라고 생각하시면 됩니다. 예를 들어, 선형 회귀 모델에서 직선의 기울기와 절편이 파라미터입니다. 모델의 구성요소이며 데이터로부터 학습되는 것입니다. 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)이란? 홀드아웃 이란? 홀드아웃 기법은 기계 학습 모델을 평가하기..
홀드아웃 이란? 홀드아웃 기법은 기계 학습 모델을 평가하기 위해 데이터를 훈련 데이터와 테스트 데이터로 나누는 방법 중 하나입니다. 이 방법을 사용하여 모델이 처음 보는 데이터에 대해 얼마나 잘 일반화되는지 확인할 수 있습니다. 코드 예시 파이썬에서 홀드아웃 기법을 사용하는 간단한 예시를 보겠습니다. scikit-learn 라이브러리를 사용하여 데이터를 나누고 모델을 평가합니다. 먼저, 필요한 라이브러리를 설치하고 가져옵니다 pip install scikit-learn 이제 홀드아웃 기법을 사용하여 데이터를 나누고 모델을 평가하는 예시 코드를 살펴보겠습니다 from sklearn.model_selection import train_test_split from sklearn.linear_model impo..