You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently developing a library (Prophetverse), which provides an sktime interface to run the timeseries models. The code is heavily based on numpyro/jax, and as I was using check_estimatorfrom sktime.utils.estimator_check, I had some issues with deep_equals functionality in skbase. (suggestion related to #323 )
The estimator has some attributes which are dictionaries with string keys and jax.numpy.ndarray values. This creates some problems with the current implementation of deep_equals, which is not robust to arbritrary attribute types. The np.any(_coerce_list(x != y)) throws error ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all().
Example of code to reproduce the error (needs jax dependency installed):
fromsktime.forecasting.naiveimportNaiveForecasteras_NaiveForecasterimportjax.numpyasjnpclassNaiveForecaster(_NaiveForecaster):
def_fit(self, y, X, fh):
self.some_dict_test_= {
"a" : jnp.array([1,2,3]).reshape((-1,1))
}
returnsuper()._fit(y, X, fh)
fromsktime.utils.estimator_checksimportcheck_estimatorcheck_estimator(NaiveForecaster, raise_exceptions=True)
Describe the solution you'd like
As the sktime interface starts to be used by third-party libraries, it would be interesting to be able to define custom equality verifications. I think it isn't possible to handle all those cases in skbase - some libraries/objects are specific to those third-party implementations.
Describe alternatives you've considered
One option would be adding a pluggy hook to allow third-party packages to define custom hook implementations to handle specific use-cases.
The text was updated successfully, but these errors were encountered:
I'm currently developing a library (Prophetverse), which provides an sktime interface to run the timeseries models. The code is heavily based on numpyro/jax, and as I was using
check_estimator
fromsktime.utils.estimator_check
, I had some issues with deep_equals functionality in skbase. (suggestion related to #323 )The estimator has some attributes which are dictionaries with string keys and
jax.numpy.ndarray
values. This creates some problems with the current implementation of deep_equals, which is not robust to arbritrary attribute types. Thenp.any(_coerce_list(x != y))
throws errorValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
.Example of code to reproduce the error (needs jax dependency installed):
Describe the solution you'd like
As the sktime interface starts to be used by third-party libraries, it would be interesting to be able to define custom equality verifications. I think it isn't possible to handle all those cases in skbase - some libraries/objects are specific to those third-party implementations.
Describe alternatives you've considered
One option would be adding a
pluggy
hook to allow third-party packages to define custom hook implementations to handle specific use-cases.The text was updated successfully, but these errors were encountered: