분류 전체보기
-
Regularized Linear Regression(정규화 선형 회귀) | Supervised Machine Learning: Regression and ClassificationMachine Learning/Stanford ML Specialization 2023. 11. 7. 22:41
Coursera Machine Learning Specialization > Supervised Machine Learning: Regression and Classification > Classification 앞에서 배운 Regularization을 이용해서 Linear Regression에 적용하면 어떻게 될까? 정규화 선형 회귀(Regluarized Linear Regression)을 위한 경사 하강법(Gradient Descent)에 대해서 알아보자. b값에 대해서는 Regularization을 할 필요 없기때문에, 아래 수식을 반복해서 경사하강을 진행하면 된다. 기존의 수식에서 w값을 업데이트 할 때, Squared Error Cost 뿐만 아니라, Loss Function을 이용해서 Reg..
-
Cost Function with Regularization (비용함수와 정규화) | Supervised Machine Learning: Regression and ClassificationMachine Learning/Stanford ML Specialization 2023. 11. 7. 00:02
Coursera Machine Learning Specialization > Supervised Machine Learning: Regression and Classification > Classification 가장 기본적으로 Regularization할 수 있는 방법은 높은 차항을 가진 변수의 parameter를 아주 작게 설정하는것이다. 예를 들어 4차항의 수식이라고 한다면, 1, 2차항은 기존과 같은 Cost Function을 이용하고, 3, 4차항은 아주 작은 숫자를 이용해서 아주 미세하게 input을 주지만 많은 영향을 주지는 않게 해서 overfitting을 피할 수 있다. 위에서 보여준대로, w3과 w4를 Regularization을 할 수 있다. 이런식으로 어떤 Parameter에 패널..
-
Addressing overfitting (과적합 문제 해결) | Supervised Machine Learning: Regression and ClassificationMachine Learning/Stanford ML Specialization 2023. 11. 6. 23:25
Coursera Machine Learning Specialization > Supervised Machine Learning: Regression and Classification > Classification 과적합 문제를 그렇다면 어떻게 해결할 수 있을까? 해결 방법에는 여러가지가 있다. Collect More Training Examples 첫번째, 충분한 예제가 있다면 고차 다항식도 과적합 문제를 일으키지 않는다. 데이터가 너무 없다면, 그 사이 공백의 데이터에 맞는 굴곡이 많은 함수가 그려질 수 있다. 만약, training example을 충분히 모아서 고차 다항식으로 트레이닝 한다면, 그 공백들을 메꿔주면서 많은 example을 만족시키고, 또한 미래의 예측을 대비해 적절하게 genera..
-
The Problem of Overfitting (과적합 문제) | Supervised Machine Learning: Regression and ClassificationMachine Learning/Stanford ML Specialization 2023. 11. 6. 22:02
Coursera Machine Learning Specialization > Supervised Machine Learning: Regression and Classification > Classification 골디락스와 곰 세마리 골디락스와 곰 세마리라는 동화가 있다. 골디락스는 어쩌다가 곰의 집에 들어가게 되는데, 그 집에는 모든 물건이 세개씩 있었다. 아빠곰을 위한 가장 큰 것, 엄마곰을 위한 중간 사이즈, 그리고 아기 곰을 위한 작은것, 모든게 세가지였다. 골디락스가 스프를 먹을 때, 첫번째 큰 그릇의 스프는 엄청 뜨거웠고, 두번째 중간사이즈 스프는 차가웠고, 마지막 그릇에 있는것은 딱 적당~ 하게 좋았다. https://youtu.be/QvnGq8wrj9E?t=250 Overfitting과 ..
-
Gradient Descent Implementation for Logistic Regression (로지스틱 회귀를 위한 경사 하강) | Supervised Machine Learning: Regression and ClassificationMachine Learning/Stanford ML Specialization 2023. 11. 6. 21:32
Coursera Machine Learning Specialization > Supervised Machine Learning: Regression and Classification > Classification Logistic Regression에 대해 다시 복기해보자. Linear Regression과 동일하게, w와 b값을 찾는 것 인데, sigmoid 함수 안에 e의 마이너스 지수로 이용된 wx + b 에서의 w(vector 이다), b의 조합을 찾아야 한다. 이전 시간에, Loss function을 이용해서 Cost를 계산하는 방법에 대해 배워봤다. 그렇다면 w와 b의 값은 어떻게 바꿔나갈 수 있을까? Linear Regression에서 했던 것처럼, Logistic Regression에도 역..
-
Cost Function for Logistic Regression (로지스틱 회귀를 위한 비용함수) | Supervised Machine Learning: Regression and ClassificationMachine Learning/Stanford ML Specialization 2023. 11. 6. 20:37
Coursera Machine Learning Specialization > Supervised Machine Learning: Regression and Classification > Classification Squared Error Cost Classification Model을 생성하기 위해서는 Logistic Regression을 이용해서 예측할 수 있다고 배웠다. 그렇다면, 다른 모델들처럼 생성된 모델의 성능을 평가할 수 있어야한다. Logistic Regression의 Cost Function이 무엇인지 알아보자. 다음과 같은 트레이닝 데이터셋이 있다고 가정하자. Tumor Size (cm) ... patient's age malignant? 10 52 1 2 73 0 5 55 0 12 4..
-
Decision Boundary (결정 경계) | Supervised Machine Learning: Regression and ClassificationMachine Learning/Stanford ML Specialization 2023. 11. 5. 18:06
Coursera Machine Learning Specialization > Supervised Machine Learning: Regression and Classification > Classification Logistic Regression이 어떻게 예측을 계산하는지 더 잘 이해하기 위해 Decision Boundry에 대해 알아보자. 앞에서 배웠듯, Logistic Regression은 Sigmoid 함수에 Linear Regression 모델을 대입해서 아래와 같은 함수를 이용해서 True가 될 확률을 0 에서 1 사이의 소수점으로 나타내주는 모델이다. 그렇다면 그것을 가지고 우리는 어떻게 판단할 수 있나? 바로 threshold를 이용해서, 해당 확률이 threshold보다 같거나 크면 T..
-
Logistic Regression (로지스틱 회귀) | Supervised Machine Learning: Regression and ClassificationMachine Learning/Stanford ML Specialization 2023. 11. 5. 17:26
Coursera Machine Learning Specialization > Supervised Machine Learning: Regression and Classification > Classification Logistic Regression (로지스틱 회귀) 로지스틱 회귀에 대해 알아보자. 로지스틱 회귀는 세계적으로 가장 많이 쓰이는 머신러닝 알고리즘중 하나이다. Logistic Regression은 분류된 데이터에 위와 같이 회전된 S자 형태의 그래프를 그려주는것 이라고 할 수 있다. Sigmoid Function(시그모이드 함수) 여기서 threshold라는 개념이 나오는데, 이 값을 이용해서 그 값에 만나는 포인트를 중심으로 True 또는 False로 값을 예측할 수 있게 된다. 여기서 아..