2011/11/6 Lars Buitinck <[email protected]>:
> 2011/11/6 Sami Liedes <[email protected]>:
>> clf = GridSearchCV(svm.sparse.SVC(C=1), TUNED_PARAMS, n_jobs=10)
>> clf.fit(tf, tc, cv=StratifiedKFold(tc, 5, indices=True))
>
> Reproduced with a much smaller set of TUNED_PARAMS. With n_jobs=1, the
> problem does not occur.
>
> One solution is to clone(best_estimator) at grid_search.py, before
> line 341 (in the if self.refit block). Currently, the code assumes
> that a fit estimator can simply be re-fit on a new dataset, which is
> not true of sparse SVMs due to the ndarray.resize calls (and probably
> not of my NB estimators either, since I hadn't considered this
> possibility).

The fit contract is that it can be called several times and that the
results of previous calls are forgotten. Warm restart should be
handled explicitly with a specific constructor parameter if required.
Alternatively one should implement partial_fit for incremental
learning.

-- 
Olivier
http://twitter.com/ogrisel - http://github.com/ogrisel

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