Open
Description
Description
Class pyts.classification.BOSSVS doesn't accept timeseries of one feature.
Advices from the error message doesn't help, but leads to another error.
Steps/Code to Reproduce
I tried all the three possible versions to use timeseries of one feature:
- The first version is just 1D-array:
import numpy as np
from pyts.classification import BOSSVS
x_train = np.random.uniform(low=0.0, high=10.0, size=(300,))
y_train = np.random.randint(low=0, high=2, size=(300,))
est = BOSSVS().fit(x_train, y_train)
This example gives:
ValueError: Expected 2D array, got 1D array instead:
array=[1.84916215 7.16606073 5.69089018 ... ].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
- After that I tried the following code
import numpy as np
from pyts.classification import BOSSVS
x_train = np.random.uniform(low=0.0, high=10.0, size=(300,))
y_train = np.random.randint(low=0, high=2, size=(300,))
est = BOSSVS().fit(x_train.reshape(-1, 1), y_train)
It gives the following error:
ValueError: If 'window_size' is an integer, it must be greater than or equal to 1 and lower than or equal to n_timestamps if 'drop_sum=False'.
- Finally I tried the following code:
import numpy as np
from pyts.classification import BOSSVS
x_train = np.random.uniform(low=0.0, high=10.0, size=(300,))
y_train = np.random.randint(low=0, high=2, size=(300,))
est = BOSSVS().fit(x_train.reshape(1, -1), y_train)
It gives the following error:
ValueError: Found input variables with inconsistent numbers of samples: [1, 300]
Versions
NumPy 1.23.4
SciPy 1.9.3
Scikit-Learn 1.2.0
Numba 0.56.4
Pyts 0.12.0
Thank You!
Metadata
Assignees
Labels
No labels