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

Moving Transform : Aggregate by week #278

Open alaindebecker opened 7 months ago

alaindebecker commented 7 months ago
Timeseries version

0.6.3

Orange version

3.36

Expected behavior

Should be able to group by weeks.

I work with data for which are undervalued on week end (due to Business not to reporting). Furthermore this data is daily on a time period and sometimes becomes weekly (also for Business reasons). I am used to replace the date by the end_of_week and group_by this date (which I can do with a Formula + Group_By, but that is a workaround).

It would be a real plus if Orange/timeseries could handle this situation.

Actual behavior

Can group by year, month, day,... and by week_of_year but not by week. Also, it is not possible to group by Year (in one column) and Week_of_year (in another).

Steps to reproduce the behavior

Click on the widget icon and look at the dropdown menu.

Additional info (worksheets, data, screenshots, ...)
janezd commented 7 months ago

This makes perfect sense. The problem is that this add-on currently has no "custodian". All regular contributors are spread thin on other parts of the project. Would you perhaps be able to contribute a patch?

Note to self or to whoever implements this: in orangecontrib.timeseries.time_blocks, basically take the number of days that passed from some date in the past (like here below) and divide by 7. Note that this will not work for dates prior to Gregorian reform because Python's datetime incorrectly assumes that 11 days have passed between Oct 4 and Oct 15 1582.

>>> (date(1582, 10, 15) - date(1582, 10, 4)).days
11

I guess we don't care about this bug, though.

janezd commented 7 months ago

Question : what is the difference between Sliding_window and Consecutive_blocks, especially in the case you do not have a measure at regular intervals ?

As far as I remember, in sliding window of size n (except those in tails), each measurement appears in n consecutive windows. In consecutive blocks, data is cut into blocks, so each measurement appears once.

alaindebecker commented 7 months ago

Would you perhaps be able to contribute a patch? With pleasure. Orange is a so nice product. However, let me get a bit more familiar with it first.