[scikit-learn] Overflow Error with Cross-Validation (but not normally fitting the data)

Sam Barnett sambarnett95 at gmail.com
Fri Aug 11 06:16:50 EDT 2017


To all,

I am working on a scikit-learn estimator that performs a version of SVC
with a custom kernel. Unfortunately, I have been presented with a problem:
when running a grid search (or even using the cross_val_score function), my
estimator encounters an overflow error when evaluating my kernel
(specifically, in an array multiplication operation). What is particularly
strange about this is that, when I train the estimator on the whole
dataset, this error does not occur. In other words: the problem only
appears to occur when the data is split into folds. Is this something that
has been seen before? How ought I fix this?

I have attached the source code below (in particular, see the notebook for
how the problem arises).

Best,
Sam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20170811/fea2af24/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kernelsqizer.py
Type: text/x-python-script
Size: 2592 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20170811/fea2af24/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SeqSVC Toy Data Tests.ipynb
Type: application/octet-stream
Size: 6613 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20170811/fea2af24/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: seqsvc.py
Type: text/x-python-script
Size: 11023 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20170811/fea2af24/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: timeseriestools.py
Type: text/x-python-script
Size: 1419 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20170811/fea2af24/attachment-0005.bin>


More information about the scikit-learn mailing list