I am trying to do a classification of time series data and came across sktime which offers many algorithms that can be used to classify time series.
However, I only manage to make RandomIntervalSpectralForest run. All other algorithms give me the following error:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_17944/639170790.py in <module>
12 cboss_params={"n_parameter_samples": 25, "max_ensemble_size": 5},
13 )
---> 14 clf.fit(X_sk, y)
~\anaconda3\lib\site-packages\pandas\core\series.py in __init__(self, data, index, dtype, name, copy, fastpath)
353 name = ibase.maybe_extract_name(name, data, type(self))
354
--> 355 if is_empty_data(data) and dtype is None:
356 # gh-17261
357 warnings.warn(
~\anaconda3\lib\site-packages\pandas\core\construction.py in is_empty_data(data)
794 is_none = data is None
795 is_list_like_without_dtype = is_list_like(data) and not hasattr(data, "dtype")
--> 796 is_simple_empty = is_list_like_without_dtype and not data
797 return is_none or is_simple_empty
798
~\anaconda3\lib\site-packages\pandas\core\generic.py in __nonzero__(self)
1535 @final
1536 def __nonzero__(self):
-> 1537 raise ValueError(
1538 f"The truth value of a {type(self).__name__} is ambiguous. "
1539 "Use a.empty, a.bool(), a.item(), a.any() or a.all()."
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
The code I am trying to run first takes a normal csv and turns it into a pandas dataframe with row for the observations and columns as time points. Then I am using sktime's utility function to turn this dataframe into one that can be used by sktime and is nested:
X_sk = from_2d_array_to_nested(X)
If I am now running:
from sktime.classification.hybrid import HIVECOTEV2
hc2 = HIVECOTEV2()
hc2.fit(X_sk, pd.Series(y))
I am getting the above mentioned error. The RandomIntervalSpectralForest however runs with exactly the same data set. I have compared the sample code and data set given on https://www.sktime.org/en/stable/api_reference/auto_generated/sktime.classification.hybrid.HIVECOTEV1.html with my dataset and can't find any difference. The sample code runs for me, but I am lost figuring out why my code doesn't run.
I am trying to recreate the problem with another data set and will edit the post once I have a working example.