Sklearn 预处理 -- *** TypeError: 找不到匹配的签名 [英] Sklearn Preprocessing -- *** TypeError: No matching signature found

查看:79
本文介绍了Sklearn 预处理 -- *** TypeError: 找不到匹配的签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试标准化 CSR 矩阵,

I am trying to normalize a CSR matrix,

但我收到此错误:(*** TypeError: No matching signature found).

from sklearn.preprocessing import normalize
normalize(x_m, norm="l2", axis=1)

矩阵是'numpy.float16'类型的609186x849632稀疏矩阵以压缩稀疏行格式存储 189140200 个元素

The matrix is 609186x849632 sparse matrix of type 'numpy.float16' with 189140200 stored elements in Compressed Sparse Row format

推荐答案

其实我解决了这个问题.我认为这是因为数据类型.将np.float16 改为np.float32,问题解决.我不知道为什么,这个问题只发生在 np.float16 数据类型.

Actually I solved the problem. I think it is because of the data type. Changing np.float16 to np.float32, solved the problem. I do not know why, this problem only happens with np.float16 data type.

这篇关于Sklearn 预处理 -- *** TypeError: 找不到匹配的签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆