GeoStat-Framework / PyKrige

Kriging Toolkit for Python
https://pykrige.readthedocs.io
BSD 3-Clause "New" or "Revised" License
741 stars 186 forks source link

sklearn 0.23 argument issue #154

Closed MuellerSeb closed 4 years ago

MuellerSeb commented 4 years ago

https://github.com/GeoStat-Framework/PyKrige/blob/1a889a7f087ac7c3e852f6e48601f4a60efca260/pykrige/compat.py#L14

This line is not working with the newest version of sklearn, resulting in a missing mean_train_score.

I think, this is because they implemented keyword-only arguments there: https://github.com/scikit-learn/scikit-learn/blob/fd237278e895b42abe8d8d09105cbb82dc2cbba7/sklearn/model_selection/_search.py#L1174

rth commented 4 years ago

Yes, we should switch to inspect.signature,

>>> from sklearn.model_selection import GridSearchCV
>>> import inspect
>>> est_sign = inspect.signature(GridSearchCV)
>>> 'return_train_score' in est_sign.parameters
True
MuellerSeb commented 4 years ago

@rth: Cool! Could you come up with a PR?