疝气病的马的存活问题"/>
使用Logistic回归来预测患有疝气病的马的存活问题
记得要写main函数
import numpy as np
from numpy import randomdef sigmoid(inX):return 1.0/(1 + np.exp(-inX))def stocGradAscent(dataMatrix, classLabels, numIter=150):m,n = np.shape(dataMatrix)weights = np.ones(n) #initialize to all onesfor j in range(numIter):dataIndex = list(range(m))for i in range(m):alpha =
更多推荐
使用Logistic回归来预测患有疝气病的马的存活问题
发布评论