biolab / orange3-timeseries

🍊 :chart_with_upwards_trend: Orange add-on for analyzing, visualizing, manipulating, and forecasting time series data.
Other
62 stars 41 forks source link

Error drawing forecast over line chart #187

Closed afy97 closed 2 years ago

afy97 commented 2 years ago
Timeseries version

0.3.12

Orange version

3.31.1

Expected behavior

Models should draw estimated values in line chart

Actual behavior

All the values, even the original data, gets shuffled and stacked to start or end of the line chart

Steps to reproduce the behavior
  1. Load the bug_report.tab (the table file zipped and attached to the end)
  2. Convert to time series using Index feature
  3. Input data to line chart

Step 3 result in line chart

image
  1. Create any model, VAR in this case but same for ARIMA too, and use it to forecast on line chart

Step 4 result in line chart

image

Pipeline screenshot

image

Model details (changing parameters does not effect the erroneous results)

image
Additional info (worksheets, data, screenshots, ...)

bug_report.tab.zip

ajdapretnar commented 2 years ago

When trying to reproduce this, I get two separate errors.

  1. When I set Index as a sequential attribute in As Timeseries:

    ----------------------------- TypeError Exception -----------------------------
    Traceback (most recent call last):
    File "/Users/ajda/orange/orange-widget-base/orangewidget/gui.py", line 2258, in __call__
    self.func(**kwds)
    File "/Users/ajda/orange/orange3-timeseries/orangecontrib/timeseries/widgets/owtabletotimeseries.py", line 71, in _on_attribute_changed
    self.commit.deferred()
    File "/Users/ajda/orange/orange-widget-base/orangewidget/gui.py", line 1995, in conditional_commit
    do_commit()
    File "/Users/ajda/orange/orange-widget-base/orangewidget/gui.py", line 2003, in do_commit
    commit.call()
    File "/Users/ajda/orange/orange-widget-base/orangewidget/gui.py", line 1870, in call
    acting_func(instance)
    File "/Users/ajda/orange/orange3-timeseries/orangecontrib/timeseries/widgets/owtabletotimeseries.py", line 117, in commit
    if np.isnan(times).any():
    TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
    -------------------------------------------------------------------------------
  2. When I use VAR as forecast:

    -------------------------- AssertionError Exception ---------------------------
    Traceback (most recent call last):
    File "/Users/ajda/orange/orange-canvas-core/orangecanvas/scheme/signalmanager.py", line 1047, in __process_next
    if self.__process_next_helper(use_max_active=True):
    File "/Users/ajda/orange/orange-canvas-core/orangecanvas/scheme/signalmanager.py", line 1085, in __process_next_helper
    self.process_node(selected_node)
    File "/Users/ajda/orange/orange-canvas-core/orangecanvas/scheme/signalmanager.py", line 713, in process_node
    self.send_to_node(node, signals_in)
    File "/Users/ajda/orange/orange-widget-base/orangewidget/workflow/widgetsscheme.py", line 806, in send_to_node
    self.process_signals_for_widget(node, widget, signals)
    File "/Users/ajda/orange/orange-widget-base/orangewidget/workflow/widgetsscheme.py", line 820, in process_signals_for_widget
    process_signals_for_widget(widget, signals, workflow)
    File "/Users/ajda/.pyenv-x86/versions/3.9.10/lib/python3.9/functools.py", line 888, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
    File "/Users/ajda/orange/orange-widget-base/orangewidget/workflow/widgetsscheme.py", line 923, in process_signals_for_widget
    handle_new_signals(widget, workflow)
    File "/Users/ajda/.pyenv-x86/versions/3.9.10/lib/python3.9/functools.py", line 888, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
    File "/Users/ajda/orange/orange-widget-base/orangewidget/workflow/widgetsscheme.py", line 910, in handle_new_signals
    widget.handleNewSignals()
    File "/Users/ajda/orange/orange3-timeseries/orangecontrib/timeseries/widgets/owlinechart.py", line 749, in handleNewSignals
    self.setup_plots()
    File "/Users/ajda/orange/orange3-timeseries/orangecontrib/timeseries/widgets/owlinechart.py", line 754, in setup_plots
    self._setup_plot(i, params)
    File "/Users/ajda/orange/orange3-timeseries/orangecontrib/timeseries/widgets/owlinechart.py", line 766, in _setup_plot
    self.__extract_data(self.data, var, self.forecast, is_time_var)
    File "/Users/ajda/orange/orange3-timeseries/orangecontrib/timeseries/widgets/owlinechart.py", line 801, in __extract_data
    assert len(x_total) == len(y_pred) + len(y_true)
    AssertionError
    -------------------------------------------------------------------------------