Skip to content

Commit

Permalink
Merge pull request #350 from WenjieDu/dev
Browse files Browse the repository at this point in the history
Remove `pypots.imputation.locf.modules` and add assertions for BTTF
  • Loading branch information
WenjieDu authored Apr 17, 2024
2 parents 1c76a86 + b610397 commit 0ffd3f9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
5 changes: 5 additions & 0 deletions pypots/forecasting/bttf/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ def BTTF_forecast(
):
dim1, dim2, T = dense_tensor.shape
start_time = T - pred_step
assert start_time > -1, (
"start_time should be larger than -1, "
"namely the number of the input tensor's time steps should be larger than pred_step."
)
assert start_time >= np.max(time_lags), "start_time should be >= max(time_lags)"
max_count = int(np.ceil(pred_step / multi_step))
tensor_hat = np.zeros((dim1, dim2, max_count * multi_step))

Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions pypots/imputation/locf/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
import numpy as np
import torch

from .modules.core import locf_numpy, locf_torch
from .core import locf_numpy, locf_torch
from ..base import BaseImputer
from ...utils.logging import logger


class LOCF(BaseImputer):
"""LOCF (Last Observed Carried Forward) imputation method. A naive imputation method that fills missing values
with the last observed value. Simple but commonly used in practice.
with the last observed value. When time-series data gets inverse on the time dimension, this method can also be
seen as NOCB (Next Observation Carried Backward). Simple but commonly used in practice.
Parameters
----------
Expand Down
6 changes: 0 additions & 6 deletions pypots/imputation/locf/modules/__init__.py

This file was deleted.

0 comments on commit 0ffd3f9

Please sign in to comment.