2014/1/21 Lorenzo Isella <lorenzo.ise...@gmail.com>: > I checked the dat files with R and there are only numeric values and no > missing values, nevertheless I get this error message when I try running > the Python script > > $ ./loan-minimal.py > Traceback (most recent call last): > File "./loan-minimal.py", line 13, in <module> > clf.fit(train, loss) > File "/usr/lib/python2.7/dist-packages/sklearn/ensemble/forest.py", line > 257, in fit > check_ccontiguous=True) > File "/usr/lib/python2.7/dist-packages/sklearn/utils/validation.py", > line 233, in check_arrays > _assert_all_finite(array) > File "/usr/lib/python2.7/dist-packages/sklearn/utils/validation.py", > line 27, in _assert_all_finite > raise ValueError("Array contains NaN or infinity.") > ValueError: Array contains NaN or infinity.
Could you check again with NumPy? np.where(~np.isfinite(train)) and similarly for loss. At least then you know whether it's genfromtxt or scikit-learn that introduces the NaN/inf. ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ Scikit-learn-general mailing list Scikit-learn-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/scikit-learn-general