我收到使用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
发生了什么事吗?