General information
This brick provides the feature of the rolling window calculation. The concept of rolling window calculation is most primarily used in signal processing and time-series data. Brick takes a window size of k (means k consecutive values at a time) at a time and performs some desired mathematical operation on it.
Description
Brick Location
Bricks → Calculation → Rolling Function
Brick Parameters
- Columns
Column/Columns from the input data used for rolling function and a function which we will apply.
- Window Size
Integer value for size of window will be used in rolling.
Brick Inputs/Outputs
- Inputs
Brick takes the dataset.
- Outputs
Brick produces the result as a new dataset with column/columns applied rolling function.
Example of usage
Let’s consider we have house prices dataset. It consists of many columns, they are: id, Neighbourhood, YearBuilt, RoofMatl, GrLivArea, YrSold, SalePrice.
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F82fb2c1d-d682-4de7-ae35-0ba6b4219df8%2FUntitled.png?table=block&id=b77c0e28-c372-4d2b-9d37-556495fea268&cache=v2)
Сonnect the input dataset to start using the brick, you'll see the dropdown with a list of possible columns for selection, alternatively, you can type the name in manually. You can add and select as many columns as you want by clicking on the '+' button in the brick settings.
After that, you need to specify the window size (default is 2) and a function to be applied (sum, mean, min, or max).
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F3f7471b8-2eda-4c36-bf07-3c81f8dbb143%2FUntitled.png?table=block&id=a790a9cf-d036-4cd5-8d0c-e37e1fedd09a&cache=v2)
Output:
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F136e477a-774f-4916-ac07-3c9e0c432c26%2FUntitled.png?table=block&id=ec89962f-3d7d-4178-bce9-a625d350aa1f&cache=v2)
Recommendations
- It is highly advised to perform Missing Values Treatment before applying rolling function on data
- Make sure, that chosen columns' types support rolling function (i. e., numerical types)