scikit-learn-contrib / py-earth

A Python implementation of Jerome Friedman's Multivariate Adaptive Regression Splines
http://contrib.scikit-learn.org/py-earth/
BSD 3-Clause "New" or "Revised" License
455 stars 121 forks source link

Segmentation fault in pyearth.tests.test_earth.test_check_estimator #145

Closed mehdidc closed 7 years ago

mehdidc commented 7 years ago

Seen in #144, it also seems to happen with the current master (commit : fd1dca92dadd01483db0023a79a8e75cbc76a708)

it is not deterministic, it does not happen all the time. it happens in python 2.7 and python 3.4 .

I can get it by launching:

python -c 'from pyearth.test.test_earth import test_check_estimator;test_check_estimator()'

@jcrudy could you please tell whether you can reproduce this ?

jcrudy commented 7 years ago

@mehdidc Yes, I am able to reproduce this. I'm not sure what's happening, but it's happening now because of the new version of scikit-learn.

jcrudy commented 7 years ago

I did a little testing and it looks like the segfault happens in the check_fit2d_1sample function in sklearn.utils.estimator_checks (commenting out that check eliminates the segfault). check_fit2d_1sample attempts to fit an Earth model with only one row of data. I'm guessing that's what causes the segfault. However, I haven't managed to get the segfault to happen by trying the same thing in a script.

jcrudy commented 7 years ago

I think I fixed the problem. Will create a pull request.

jcrudy commented 7 years ago

Fixed.