2011/11/6 Olivier Grisel <[email protected]>:
> 2011/11/6 Lars Buitinck <[email protected]>:
>> 2011/11/6 Vlad Niculae <[email protected]>:
>>> This is exactly what I would expect as well. I think this is the
>>> biggest gain of having objects instead of functions: being able to
>>> store init parameters in an object that you will then fit and evaluate
>>> on different sets.
>>
>> Isn't that what base.clone is for?
>
> clone is just for cloning (e.g. for processing with the same initial
> parameters on different data in parrallel).

Alright. I ran through the Naive Bayes code and I think it upholds
this contract. As for Sami's problem, the solution of cloning the
estimator before refitting should work and takes only one line of
code.

Shall we apply this workaround in the master as well? That way, grid
search will also work with user-defined estimators that don't uphold
the contract; better safe than sorry. I've already refactored Sami's
script into a testcase with a custom BrokenEstimator.

-- 
Lars Buitinck
Scientific programmer, ILPS
University of Amsterdam

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to