I am trying to implement randomforest in Python. While running the code I got this error. Although I had already converted from float32 to float64 using :
x_arr = np.array(train_df, dtype='float64')
Traceback(most recent call last):
File "C:\Python27\randomforest.py", line 67, in <module>
forest=forest.fit(x_array[0::,1::],x_array[0::,0])
File "C:\Python27\lib\site-packages\sklearn\ensemble\forest.py", line 212, in fit
X = check_array(X, dtype=DTYPE, accept_sparse="csc")
File "C:\Python27\lib\site-packages\sklearn\utils\validation.py", line 398, in check_array
_assert_all_finite(array)
File "C:\Python27\lib\site-packages\sklearn\utils\validation.py", line 54, in _assert_all_finite
" or a value too large for %r." % X.dtype)
ValueError: Input contains NaN, infinity or a value too large for dtype('float32').
Please can somebody help?
dtype=np.float64instead?