Hi everybody.
I'd like to convert an array of integer categorial features to a sparse 
indicator matrix.
So my data points look like
x =[ 100, 1, 5, 10]
These are indices for feature-bins which don't really have an ordering.
Therefore I want to convert them to a one-hot encoding per feature.

What is the best way in sklearn to achieve this? This looks a bit
like the DictVectorizer, I think.
But I'd have to convert my array to a dict first, which seems pretty
wasteful.
Is there a better way in sklearn?

If not, do you think this kind of encoding is common enough to
be included in sklearn?

Cheers,
Andy

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to