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
457 stars 122 forks source link

iteritems error on Python 3 #78

Closed mangecoeur closed 9 years ago

mangecoeur commented 9 years ago

Py-earth mostly seems to work fine in Python 3, with the exception of the Model.__repr__() function (line 788 in earth.py) which uses iteritems which doesn't work in py3. Since params should be short there shouldn't be any performance difference on py2 just using items:

        for k, v in self.get_params().iteritems():

becomes

        for k, v in self.get_params().items():
jcrudy commented 9 years ago

Thanks for reporting this. It's fixed now, and py-earth should now be Python 3 compatible. Please report back if you find otherwise.