这是我的函数logistic (x,w)
def logistic(x, w):
return 1.0 / (1.0 + np.exp(-x.dot(w)))
w = 2 * np.random.ranf((NDIM, 1)) - 1
def score(matrix, w):
y= np.matrix ([':,0])
X= np.matrix ([':,1:])
申请时:
pred = logistic(X, w)
我收到错误:
" cannot cast array data from dtype('float64') to dtype('u32') according to the rule 'safe' "