@Andreas

> The Pipeline is designed to do exactly this:
>
> http://scikit-learn.org/dev/modules/generated/sklearn.pipeline.Pipeline.html#sklearn.pipeline.Pipeline
> Example here:
>
> http://scikit-learn.org/dev/auto_examples/feature_selection_pipeline.html#example-feature-selection-pipeline-py
> You can use it to build an estimator that does both things and has both
> parameters.


I puzzled over this for a while but didn't find a way to make this work
with the pipeline.  The problem seems to be that I don't want to perform
two steps sequentially.  That is, I don't first want to do the recursive
feature elimination, and then with that reduced set of features find the
best value of C for regularization.  The problem with this is that the
recursive feature elimination already depends on the value of C.  So I want
the search for the right value of C to take place within the recursive
feature elimination, not after it.

@gael

> If I understand your problem correctly, as with every composed estimator,
> you can set the C parameter of the 'estimator' attribute of the RFE using
> the estimator__C syntax in the grid search.
>

Hmm, if I look at the pipeline, I see the estimator__C syntax that you
speak of (although the pipeline doesn't seem quite right for the reasons
mentioned above).  However, I don't see where the grid search uses that
syntax.

The problem seems to be that in order to initialize an RFECV object, I need
to feed it an estimator object that already has C set.  I can't just
provide a class as the estimator for RFECV.  In order to create an object,
I need to set C explicitly, which I don't want to do (I want to let the
grid search do that).

I'm not sure if that makes sense, but please try putting your proposed
solution into code, and you might see the problem I'm having (or maybe
solve it).

Thanks,

Conrad
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to