Logistic Regression이란,
- Regression이지만 Classification!
- Linear Regression과 동일하게 선형 방정식을 학습하지만, 확률이 출력되어야 하므로 Sigmoid 함수를 이용함.
Sigmoid 함수 - numpy
import numpy as np
import matplotlib.pyplot as plt
z = np.arange(-5, 5, 0.1)
phi = 1 / (1 + np.exp(-z))
plt.plot(z, phi)
plt.xlabel('z')
plt.ylabel('phi')
plt.show()
- 어떠한 z값이 오더라도, 절대로 0~1 사이의 범위를 벗어날 수 없음.
Multi-Classification with Logistic Regression