004-python實現邏輯迴歸2/2

python - 3.7 pycharm numpy-1.15.1 pandas-0.23.4 matplotlib-2.2.3 """ 梯度計算:對J(θ)求θ的偏導 """ def gradient(X, Y, theta): grad = np.zeros(theta.shape) # 根據3個不同的θ求出對應的梯度 error = (model(X, theta) - Y).
相關文章
相關標籤/搜索