On Tue, Jul 16, 2013 at 05:09:09PM +0200, Eustache DIEMERT wrote: > What is missing IMHO is a simple example on how to actually transform the > dataset after the initial feature selection !
I beg to disagree. We have a huge amount of examples. Probably too many. We need to move people away from copy-pasting examples, and have them actually learn the API of the package, and numpy: teaching people to fish rather than giving them a fish. > I'm thinking something really simple but that I couldn't find anywhere like: > """ > clf = GradientBoostingClassifier() > clf.fit(X,y) > feats_mask = [ i > 1e-3 for i in clf.feature_importances_ ] > X = X.compress(feats_mask, axis=1) Yes. Learn numpy. Seriously, this may sound provocative but it's the biggest favor you can do yourself. It is a vast library, and does require some learning indeed. And by the way, if you new numpy, you would now that what you have written above is very inefficient and you could write something like "X = X[:, clf.feature_importances_ > 1e-3]" That said, as Olivier mentioned, the GradientBoostingClassifier could implement a "transform", and that might be a good idea. Cheers, Gaƫl PS: Sorry if I come out a bit harsh, I had a pretty bad day fighting with administration. ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ Scikit-learn-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
