Re: [Scikit-learn-general] passing parameters to a transformer

2015-04-30 Thread Pagliari, Roberto
learn-general] passing parameters to a transformer You need to give more context. Can you give a minimal example that runs but breaks? On 04/29/2015 02:44 PM, Pagliari, Roberto wrote: I'm not sure why but when I do something like the below, nestimators becomes zero, despite the default val

Re: [Scikit-learn-general] passing parameters to a transformer

2015-04-29 Thread Vlad Niculae
Is there a reason why you are (still) not respecting the API constraints for custom estimators given in the documentation? __init__ should only set parameters on self that have (exactly) the same name as the arguments passed to it. Your __init__ should be: self.k = k self.nestim

Re: [Scikit-learn-general] passing parameters to a transformer

2015-04-29 Thread Andreas Mueller
You need to give more context. Can you give a minimal example that runs but breaks? On 04/29/2015 02:44 PM, Pagliari, Roberto wrote: I'm not sure why but when I do something like the below, nestimators becomes zero, despite the default value of 2000. class myCustomTransformer(BaseEstimator, T

[Scikit-learn-general] passing parameters to a transformer

2015-04-29 Thread Pagliari, Roberto
I'm not sure why but when I do something like the below, nestimators becomes zero, despite the default value of 2000. class myCustomTransformer(BaseEstimator, TransformerMixin): def __init__(self, k=5, nestimators=2000): self.k_ = k self.clf_ = RandomForestClassifier(n_estima