Skip to content

Errof for tsfresh features set #269

@MislavSag

Description

@MislavSag

I am using the new version of the package, after some time and have problems with tsfresh features set.

I have converted a data into the tibble format.

       symbol                date  close
       <char>              <POSc>  <num>
    1:    SPY 2004-01-02 10:00:00 112.11
    2:    SPY 2004-01-02 11:00:00 111.90
    3:    SPY 2004-01-02 12:00:00 111.77
    4:    SPY 2004-01-02 13:00:00 111.70
    5:    SPY 2004-01-02 14:00:00 110.93
   ---                                  
31305:    SPY 2021-10-20 12:00:00 452.50
31306:    SPY 2021-10-20 13:00:00 451.80
31307:    SPY 2021-10-20 14:00:00 452.23
31308:    SPY 2021-10-20 15:00:00 452.40
31309:    SPY 2021-10-20 16:00:00 452.00

When calling the function

        theft::calculate_features(
          tsibble::as_tsibble(x_, key = "symbol", index = "date"),
          feature_set = params
        )

where params i tsfresh, I get an error

Running computations for tsfresh...
Feature Extraction:   0%|          | 0/1 [00:00<?, ?it/s]
Error in py_call_impl(callable, call_args$unnamed, call_args$named) : 
  numpy._core._exceptions._UFuncBinaryResolutionError: ufunc 'add' cannot use operands with types dtype('<M8[ns]') and dtype('<M8[ns]')
Run `reticulate::py_last_error()` for details.

I tried to coinvert datetime to date, just to check if it will work

> tsibble::as_tsibble(x_, key = "symbol", index = "date")
# A tsibble: 4,482 x 3 [1D]
# Key:       symbol [1]
   symbol date       value
   <chr>  <date>     <dbl>
 1 SPY    2004-01-02  112.
 2 SPY    2004-01-05  112.
 3 SPY    2004-01-06  112.
 4 SPY    2004-01-07  112.
 5 SPY    2004-01-08  113.
 6 SPY    2004-01-09  113.
 7 SPY    2004-01-12  113.
 8 SPY    2004-01-13  113.
 9 SPY    2004-01-14  113.

But than I get an error

Running computations for tsfresh...
Feature Extraction:   0%|          | 0/1 [00:00<?, ?it/s]
Error in py_call_impl(callable, call_args$unnamed, call_args$named) : 
  TypeError: unsupported operand type(s) for +: 'datetime.date' and 'datetime.date'
Run `reticulate::py_last_error()` for details.

I have installed the latest versoins of all packages (R and py)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions