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
~/miniconda3/envs/pytorch/lib/python3.9/site-packages/sklearn/base.py in fit_predict(self, X, y)
749 # non-optimized default implementation; override when a better
750 # method is possible for a given clustering algorithm
--> 751 self.fit(X)
752 return self.labels_
753
~/miniconda3/envs/pytorch/lib/python3.9/site-packages/skfda/ml/clustering/_kmeans.py in fit(self, X, y, sample_weight)
327 n_iter,
328 ) = (
--> 329 self._algorithm(
330 fdata=fdata,
331 random_state=random_state,
~/miniconda3/envs/pytorch/lib/python3.9/site-packages/multimethod/init.py in call(self, *args, **kwargs)
419 """Resolve and dispatch to best method."""
420 params = self.signature.bind(*args, **kwargs).args if (kwargs and self.signature) else args
--> 421 func = self.dispatch(*params)
422 return func(*args, **kwargs)
423
~/miniconda3/envs/pytorch/lib/python3.9/site-packages/multimethod/init.py in dispatch(self, *args)
352 def dispatch(self, *args) -> Callable:
353 types = tuple(map(type, args))
--> 354 if not any(map(issubclass, types, self.generics)):
355 return self[types]
356 matches = {key for key in list(self) if isinstance(key, signature) and key.instances(*args)}
~/miniconda3/envs/pytorch/lib/python3.9/typing.py in subclasscheck(self, cls)
716
717 def subclasscheck(self, cls):
--> 718 raise TypeError("Subscripted generics cannot be used with"
719 " class and instance checks")
720
TypeError: Subscripted generics cannot be used with class and instance checks
This is due to an error in one of our dependencies (coady/multimethod#113). While this is being investigated, I recommend installing an older version of multimethod:
Bug description summary
TypeError Traceback (most recent call last)
/var/folders/js/lpf4z00557sb1m38br8bzj_476fsrl/T/ipykernel_16178/3403943172.py in
8 random_state=0,
9 )
---> 10 fda_clusters = fda_kmeans.fit_predict(X)
~/miniconda3/envs/pytorch/lib/python3.9/site-packages/skfda/_utils/_sklearn_adapter.py in fit_predict(self, X, y)
157 y: object = None,
158 ) -> NDArrayInt:
--> 159 return super().fit_predict(X, y) # type: ignore[no-any-return]
160
161
~/miniconda3/envs/pytorch/lib/python3.9/site-packages/sklearn/base.py in fit_predict(self, X, y)
749 # non-optimized default implementation; override when a better
750 # method is possible for a given clustering algorithm
--> 751 self.fit(X)
752 return self.labels_
753
~/miniconda3/envs/pytorch/lib/python3.9/site-packages/skfda/ml/clustering/_kmeans.py in fit(self, X, y, sample_weight)
327 n_iter,
328 ) = (
--> 329 self._algorithm(
330 fdata=fdata,
331 random_state=random_state,
~/miniconda3/envs/pytorch/lib/python3.9/site-packages/skfda/ml/clustering/_kmeans.py in _algorithm(self, fdata, random_state)
266 centroids_old.data_matrix[...] = centroids.data_matrix
267
--> 268 distances_to_centroids = pairwise_metric(fdata, centroids)
269
270 self._update(
~/miniconda3/envs/pytorch/lib/python3.9/site-packages/skfda/misc/metrics/_utils.py in call(self, elem1, elem2)
181 ) -> NDArrayFloat:
182 """Evaluate the pairwise metric."""
--> 183 optimized = pairwise_metric_optimization(self.metric, elem1, elem2)
184
185 return (
~/miniconda3/envs/pytorch/lib/python3.9/site-packages/multimethod/init.py in call(self, *args, **kwargs)
419 """Resolve and dispatch to best method."""
420 params = self.signature.bind(*args, **kwargs).args if (kwargs and self.signature) else args
--> 421 func = self.dispatch(*params)
422 return func(*args, **kwargs)
423
~/miniconda3/envs/pytorch/lib/python3.9/site-packages/multimethod/init.py in dispatch(self, *args)
352 def dispatch(self, *args) -> Callable:
353 types = tuple(map(type, args))
--> 354 if not any(map(issubclass, types, self.generics)):
355 return self[types]
356 matches = {key for key in list(self) if isinstance(key, signature) and key.instances(*args)}
~/miniconda3/envs/pytorch/lib/python3.9/typing.py in subclasscheck(self, cls)
716
717 def subclasscheck(self, cls):
--> 718 raise TypeError("Subscripted generics cannot be used with"
719 " class and instance checks")
720
TypeError: Subscripted generics cannot be used with class and instance checks
Code to reproduce the bug
Expected result
successfully work
Actual result
optimization error reported
Traceback (if an exception is raised)
No response
Software versions
scikit-fda version:0.9
OS: MAC 13.2.1 (22D68)
Additional context
No response
The text was updated successfully, but these errors were encountered: