根据规则'safe',无法将数组数据从dtype('float64')转换为dtype('u32')

时间:2015-12-05 18:30:41

标签: python arrays

这是我的函数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' " 

0 个答案:

没有答案