kiudee / cs-ranking

Context-sensitive ranking and choice in Python with PyTorch
https://cs-ranking.readthedocs.io
Apache License 2.0
66 stars 15 forks source link

get_params does not accept keyword argument deep #171

Closed kiudee closed 4 years ago

kiudee commented 4 years ago

The official scikit-learn BaseEstimator interface specifies that the get_params method should handle the keyword parameter deep: https://github.com/scikit-learn/scikit-learn/blob/0fb307bf39bbdacd6ed713c00724f8f871d60370/sklearn/base.py#L189

Since keyword arguments are not caught, our library will error out with:

File ".../lib/python3.7/site-packages/sklearn/base.py",
line 85, in clone
    new_object_params = estimator.get_params(deep=False)
TypeError: get_params() got an unexpected keyword argument 'deep'

A quick fix should be to capture all keyword arguments and to default to deep=True (what we are currently doing).

timokau commented 4 years ago

Fixed in https://github.com/kiudee/cs-ranking/pull/172.