2012/1/6 Dhruvkaran Mehta <[email protected]>: > Is there a convenient way in scikits to go from "string" features like:
... > to a numpy matrix like: ... At present, no. But I donated a scikit-learn wrapper to NLTK yesterday, which translates NLTK's featuresets (dicts mapping feature names to numeric or boolean values) to scipy.sparse arrays. You might be able to adapt it to your purposes: https://github.com/nltk/nltk/blob/master/nltk/classify/scikitlearn.py (Look esp. at the train and _featuresets_to_array methods.) -- Lars Buitinck Scientific programmer, ILPS University of Amsterdam ------------------------------------------------------------------------------ RSA(R) Conference 2012 Mar 27 - Feb 2 Save $400 by Jan. 27 Register now! http://p.sf.net/sfu/rsa-sfdev2dev2 _______________________________________________ Scikit-learn-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
