Gradient Decent를 이용한 로지스틱 회귀 구현 (2)
Numpy를 이용한 구현
데이터 불러오기
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
data = pd.read_csv('assignment2.csv')
data.head()Train Test 데이터 나누기
X_train, X_test, y_train, y_test = train_test_split(data.iloc[:, 1:], data.iloc[:, 0], random_state = 0)X_train.shape, X_test.shape, y_train.shape, y_test.shape((150, 3), (50, 3), (150,), (50,))데이터 스케일링
1. sigmoid

2. log likelihood

3. gradient Ascent
4. Fitting
5. 예측
6. confusion_matrix
Last updated