sklearn.svm.SVC用户警告:indptr数组具有非整数数据类型(float64)

2024-04-25 13:20:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我因为使用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.LinearSVC替换svm.SVC,它会变得完全好。有人知道svm.SVC是怎么回事吗?你知道吗


Tags: ofthe警告istfsklearnfeaturefeatures