sklearn.svm.SVC - UserWarning:indptr数组有非整数dtype(float64)

时间:2015-10-07 01:46:20

标签: python numpy scipy scikit-learn

我收到使用sklearn.svm.SVC(版本0.16.1)

的警告
logger.info('the shape of tf_feature is : (%d, %d)', 
  features.tf_feature.shape[0],features.tf_feature.shape[1])
## output: the shape of tf_feature is : (11269, 53975)

svc = svm.SVC(C = 0.05)
## tf_feature is a sparse csr matrix
svc.fit(features.tf_feature, features.label) # getting warning here

完整的警告是

sr/lib/python3/dist-packages/scipy/sparse/compressed.py:119: UserWarning: indptr array has non-integer dtype (float64) % self.indptr.dtype.name)

奇怪的是,如果我将svm.SVC替换为svm.LinearSVC,那就变得非常好了。有人知道svm.SVC发生了什么事吗?

0 个答案:

没有答案