Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions multiverse/classification/_timesnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ def _resolve_device(self) -> torch.device:
return torch.device(self.device)
return torch.device("cuda" if torch.cuda.is_available() else "cpu")

def _convert_X(self, X: np.ndarray) -> tuple[np.ndarray, np.ndarray]:
@staticmethod
def _preprocess_X(X: np.ndarray) -> tuple[np.ndarray, np.ndarray]:
"""
Convert aeon numpy3D input to TimesNet layout and create a mask.

Expand Down Expand Up @@ -296,7 +297,7 @@ def _fit(self, X: np.ndarray, y):
"X.shape[2] to match seq_len."
)

x_t, mask = self._convert_X(X)
x_t, mask = self._preprocess_X(X)

if self.standardise:
self.scaler_ = _StandardisePerChannel().fit(x_t)
Expand Down Expand Up @@ -432,7 +433,7 @@ def _predict_proba(self, X: np.ndarray) -> np.ndarray:
f"seq_len={self.seq_len_}."
)

x_t, mask = self._convert_X(X)
x_t, mask = self._preprocess_X(X)

if self.scaler_ is not None:
x_t = self.scaler_.transform(x_t)
Expand Down
Loading