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.nestimators = nestimators

and self.clf_ should be constructed in fit, not in init.

Vlad

> On 29 Apr 2015, at 14:44, Pagliari, Roberto <rpagli...@appcomsci.com> 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, TransformerMixin):
>     def __init__(self, k=5, nestimators=2000):
>         self.k_ = k
>         self.clf_ = RandomForestClassifier(n_estimators=nestimators)
> 
>     def fit(self, X, y):
>         # some stuff
>         return self
> 
>     def transform(self, X):
>         # do some stuff
>         return some_stuff
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud 
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y_______________________________________________
> Scikit-learn-general mailing list
> Scikit-learn-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to