Kaggle-ValueError: Input contains NaN, infinity or a value too large for dtype('float32').
2015-06-24 21:32
776 查看
在按照教程一步一步做的时候,出现如下错误:
ValueError: Input
contains NaN, infinity
or a value too large for dtype('float32').
解决办法:
https://www.kaggle.com/c/word2vec-nlp-tutorial/forums/t/11266/valueerror-array-contains-nan-or-infinity
Just for the record, I had the same error message and found that it was caused by NaN's. I imputed them as follows:
from sklearn.preprocessing import Imputer
trainDataVecs = Imputer().fit_transform(trainDataVecs)
如此即可。
ValueError: Input
contains NaN, infinity
or a value too large for dtype('float32').
解决办法:
https://www.kaggle.com/c/word2vec-nlp-tutorial/forums/t/11266/valueerror-array-contains-nan-or-infinity
Just for the record, I had the same error message and found that it was caused by NaN's. I imputed them as follows:
from sklearn.preprocessing import Imputer
trainDataVecs = Imputer().fit_transform(trainDataVecs)
如此即可。
相关文章推荐
- 关于 UITextField
- ios UIButton的常用属性
- deque时间复杂度和vector,list比较
- IOS UILabel的常用属性
- Android属性之build.prop生成过程
- [leetcode] Unique Paths
- iOS学习笔记(3)UIButton
- UITextField隐藏键盘的几种方式
- Sicily 1443. Printer Queue
- 解决 Errors running builder 'DeploymentBuilder' on project ' .
- View requires API level 14 (current min is 8): <Switch>
- CSU 1658 IQ of XUEXX’s descendants 矩阵快速幂
- C# WebRequest WebClient Post请求Demo
- ZJU2136 Longest Ordered Subsequence
- iOS下载文件之NSData -UIImage
- UILabel和UITableview自定义分割线
- Bluemix云平台实践: CLI应用之DB2控制台(2)
- Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Query was empty
- Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Query was empty
- An internal error occurred during: "Building workspace". GC overhead limit exceeded