Dear All,
Apologies for not being able to provide a 100% self contained example, but
I am new to sklearn and I can provide the small snippet I try to run, but
not the associated data (very large).
I run the following script on my machine
#!/usr/bin/env python
import scipy as s
from sklearn.ensemble import RandomForestRegressor
train = s.genfromtxt('train_data_fixed.dat')
loss = s.genfromtxt('loss_data.dat')
clf = RandomForestRegressor(n_jobs=10, verbose=3)
clf.fit(train, loss)
"train" contains the predictors and "loss" contains the outcome I am using
to train my random forest model.
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.
I am running debian testing, amd64 on my box, and I installed sklearn from
the standard repositories.
Does anybody have any idea of what is going on (even if the original data)?
Any suggestion is welcome.
Cheers
Lorenzo
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general