So I followed the advice from Andreas but now I get this error when
calling clone:

PATH/scikit-learn/sklearn/base.pyc in clone(estimator, safe)
     66                     and param1.dtype == param2.dtype
     67                     # We have to use '.flat' for 2D arrays
---> 68                     and param1.flat[0] == param2.flat[0]
     69                     and param1.flat[-1] == param2.flat[-1]
     70                 )

ValueError: The truth value of an array with more than one element is
ambiguous. Use a.any() or a.all()

I think that this could be because one of the parameters of __init__ is
a numpy array of objects, containing numeric numpy arrays.

Do you think I could just use Python's copy library in place of clone?

http://docs.python.org/2/library/copy.html

Thanks,
Michal

On 25/07/13 23:30, Andreas Mueller wrote:
> Hi Michal.
> The documentation is here:
> http://scikit-learn.org/dev/developers/index.html#rolling-your-own-estimator
> It is indeed a tad hard to find currently.
> We are working on a slight reorganization of the docs ;)
> 
> If you are ok with relying on scikit-learn, you can inherit from
> BaseEstimator and ClassifierMixin, then implement fit, predict and 
> __init__ (to set the parameters).
> 
> Cheers,
> Andy
> 
> On 07/25/2013 10:05 PM, Michal Romaniuk wrote:
>> Hi,
>>
>> I'm working on a customized classifier and I would like it to be
>> compatible with sklearn, so that I can use it with pipelines,
>> GridSearchCV and replicate it using sklearn's clone function. I've
>> looked at the code for some classifiers but I'm not sure which base
>> classes to use. Is there any documentation available for this?
>>
>> Thanks,
>> Michal
>>
>>
>> ------------------------------------------------------------------------------
>> 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
> 
> 
> ------------------------------------------------------------------------------
> 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
> 


------------------------------------------------------------------------------
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

Reply via email to