Hi list,
Right now, when a sparse matrix is given at the validation utility
'as_float_array', it crashes with the following incomprehensible error
message:
/usr/local/lib/python2.7/dist-packages/scikit_learn-0.10_git-py2.7-linux-x86_64.
egg/sklearn/utils/validation.pyc in as_float_array(X, copy)
60 X = X.astype(np.float32)
61 else:
---> 62 X = X.astype(np.float64)
63 return X
64
TypeError: float() argument must be a string or a number
This is not a good option. I can implement two changes:
1. Always let sparse matrices pass through (of course with the
conversion to float dtype happening)
2. Always fail, but raise a comprehensible message.
3. Have a keyword argument to choose between one of the above (which
should be the default?)
What do people think is the best option? Given the fact that we quite
often accept working with sparse matrices, I am leaning toward 3, with a
default of True.
G
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general