phausamann / sklearn-xarray

Metadata-aware machine learning.
http://bit.do/sklearn-xarray
BSD 3-Clause "New" or "Revised" License
102 stars 12 forks source link

clone equality check of wrapped estimator fails for some types of parameters #43

Open phausamann opened 5 years ago

phausamann commented 5 years ago

This is going to be a serious issue as of sklearn version 0.20 because clone will raise an exception. The only workaround is to use wrap with compat=True.

This seems to happen for tuples, lists and ndarrays, among others.

import numpy as np
from sklearn_xarray import wrap
from sklearn.base import clone
from sklearn.decomposition import DictionaryLearning

dl = wrap(DictionaryLearning(dict_init=np.ones((100, 100))))
clone(dl)