×
BigML is working hard to support a wide range of browsers. Your experience will be better with:
English
Sign up / in
Sign up
Sign in
or Sign in with...
Amazon
Github
GitLab
Google
Toggle navigation
PRODUCT
Features
Releases
What's New
GETTING STARTED
PRICING
Subscriptions
Private Deployments
Training
Certifications
BigML for Education
SUPPORT
Toggle navigation
PRODUCT
Features
Releases
What's New
GETTING STARTED
PRICING
Subscriptions
Private Deployments
Training
Certifications
BigML for Education
SUPPORT
License
Oops!
We could not process your request!
Time series feature engineering: lags and windows aggregations | BigML.com
×
Embed this Script in your web site
Copy & Paste this code into your HTML code:
whizzml
Public
whizzml's
Scripts
77
Models
0
Datasets
0
0
FREE
BUY
Time series feature engineering: lags and windows aggregations
Details:
Created
Thu, 8 Oct 2026 15:01:19 +0000
Published
Thu, 8 Oct 2026 17:26:19 +0000
Description:
Created using BigMLer
Tags:
BigMLer
BigMLer_ThuOct0826_170119
URL:
https://bigml.com/user/whizzml/gallery/script/6ac7b03f944055c6d74afbb8
Script
FREE
Source code
;; Adds lags to a normalized timeseries file by creating a new field that ;; reflects the value of the field in the previous [x, y, z, ...] records ;; Inputs: ;; field-lags: map corresponding to the fields to be used and the ;; lags to be applied. E.g. ;; {"steps" [1 3 7 14]} ;; will create columns that contain the steps in the previous ;; record, the third before, the 7th before and the ;; 14th before (define (lags-new-fields field-lags) (flatten (for (field (keys field-lags)) (for (lag (field-lags field)) (let (name (str field "-" lag) expr (flatline "(f {{field}} -{lag})")) {"names" [name] "field" expr}))))) ;; Adds windows to a normalized timeseries file by creating a new field that ;; reflects the aggregated value of the field in the previous records range ;; Inputs: ;; field-windows: map corresponding to the fields to be used and the ;; windows to be applied. E.g. ;; {"steps" {"mean" [[-3 -1] [-7 -1] [-14 -1]]}} ;; will compute the mean value of the steps in the rows ;; -1 to -3 (both included), -1 to -7 and -1 to -14 (define (windows-new-fields field-windows) (flatten (for (field (keys field-windows)) (for (aggr-fn (keys (field-windows field))) (for (wrange ((field-windows field) aggr-fn)) (let (name (str field "_" aggr-fn wrange) [start end] wrange expr (flatline "(window-{aggr-fn} {{field}} {start} {end})")) {"names" [name] "field" expr})))))) (define (ts-feature-engineering ds-id field-lags field-windows) (let (new_fields (lags-new-fields field-lags) new_fields (concat new_fields (windows-new-fields field-windows))) (create-dataset {"origin_dataset" ds-id "new_fields" new_fields}))) (define expanded-ts-ds (ts-feature-engineering ds-id field-lags field-windows))
Description
Created using BigMLer
Created using BigMLer
Show more
Inputs
Outputs
License:
Creative Commons Zero V1.0
Script
FREE
Time series feature engineering: lags and windows aggregations | BigML.com
Sending Request...
Sending Request...