当前位置:首页 >> 核电技术聚变聚能设备 >> 【TypeError- float() argument must be a string or a number, not ‘map’】,htc one vx

【TypeError- float() argument must be a string or a number, not ‘map’】,htc one vx

cpugpu芯片开发光刻机 核电技术聚变聚能设备 2
文件名:【TypeError- float() argument must be a string or a number, not ‘map’】,htc one vx 【TypeError: float() argument must be a string or a number, not ‘map’】

初始 相关系数过滤法调用函数 from sklearn.feature_selection import SelectKBest from scipy.stats import pearsonr SelectKBest(lambda X,Y:np.array(map(lambda x:pearsonr(x,Y),X.T)).T,k=2) .fit_transform(X_test,y_test)

TypeError: float() argument must be a string or a number, not ‘map’ 原因: python3下的map()函数返回类型为iterators,不再是list,所以将map语句修改为:x = list(map())

修改: SelectKBest(lambda X,Y:np.array(list(map(lambda x:pearsonr(x,Y),X.T))).T,k=2) .fit_transform(X_test,y_test)

协助本站SEO优化一下,谢谢!
关键词不能为空
同类推荐
«    2025年12月    »
1234567
891011121314
15161718192021
22232425262728
293031
控制面板
您好,欢迎到访网站!
  查看权限
网站分类
搜索
最新留言
文章归档
网站收藏
友情链接