Timeseriesflattener: A Python package for summarizing features from (medical) time series.
Open accessAbstract
Time series from e.g.electronic health records often have a large number of variables that are sampled at irregular and differing intervals.Before this type of data can be used for prediction modelling with machine learning methods such as logistic regression or XGBoost (Chen & Guestrin, 2016), the data needs to be reshaped.In essence, the time series need to be flattened so that each prediction time is represented by a vector of predefined length.This vector should hold the set of predictor values and an outcome value.These predictor values can be constructed by aggregating the preceding values in the time series within a certain time window.This process of flattening the data lays the foundation for further analyses and requires handling a number of tasks such as 1) how to deal with missing values, 2) which value to use if none fall within the prediction window, 3) how to handle variables measured multiple times within the chosen time window, and 4) how to handle predictors that attempt to look further back than the start of the dataset.
The claims and statistics of this paper haven’t been checked yet.
Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.
Integrity signals
Registry
Cites
Statistics
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
Schizophrenia and bipolar disorder have low prevalence in younger individuals and heterogeneous symptoms in late-onset.
“Only patients aged 15 to 60 years were included due to the low prevalence of schizophrenia and bipolar disorder in younger individuals (eFigure 1 in Supplement 1) and heterogeneous symptoms in late-onset schizophrenia and bipolar disorder.”
From Predicting Diagnostic Progression to Schizophrenia or Bipolar Disorder via Machine Learning (2025) · cites this paper as [21]
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Cites
XGBoost: A Scalable Tree Boosting System
Chen, T., & Guestrin, C. (2016) · Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining · doi:10.1145/2939672.2939785 · Cited by 54,569 · see citing works
MIMIC-III, a freely accessible critical care database
Johnson, A. E. W., Pollard, T. J., Shen, L., Lehman, L.-W. H., Feng, M., Ghassemi, M., Moody, B., Szolovits, P., Anthony Celi, L., & Mark, R. G. (2016) · Scientific Data · doi:10.1038/sdata.2016.35 · Cited by 8,141 · see citing works
Scalable and accurate deep learning with electronic health records
Rajkomar, A., Oren, E., Chen, K., Dai, A. M., Hajaj, N., Hardt, M., Liu, P. J., Liu, X., Marcus, J., Sun, M., et al. (2018) · npj Digital Medicine · doi:10.1038/s41746-018-0029-1 · Cited by 2,648 · see citing works
Scalable and accurate deep learning with electronic health records.
Rajkomar, A., Oren, E., Chen, K., Dai, A. M., Hajaj, N., Hardt, M., Liu, P. J., Liu, X., Marcus, J., Sun, M., et al. (2018) · eScholarship (California Digital Library) · Cited by 2,242 · see citing works
(2015) · neural information processing systems · Cited by 1,305 · see citing works
Machine Learning for Clinical Outcome Prediction
Shamout, F. E., Zhu, T., & Clifton, D. A. (2020) · IEEE Reviews in Biomedical Engineering · doi:10.1109/rbme.2020.3007816 · Cited by 242 · see citing works
Tang, S., Davarmanesh, P., Song, Y., Koutra, D., Sjoding, M. W., & Wiens, J. (2020) · Journal of the American Medical Informatics Association · doi:10.1093/jamia/ocaa139 · Cited by 88 · see citing works
Lauritsen, S. M., Thiesson, B., Jørgensen, M. J., Riis, A. H., Espelund, U. S., Weile, J. B., & Lange, J. (2021) · npj Digital Medicine · doi:10.1038/s41746-021-00529-x · Cited by 61 · see citing works
Imrie, F., Cebere, B., McKinney, E. F., & van der Schaar, M. (2023) · PLOS Digital Health · doi:10.1371/journal.pdig.0000276 · Cited by 47 · see citing works
Hansen, L., Enevoldsen, K., Bernstorff, M., Nielbo, K. L., Danielsen, A. A., & Østergaard, S. D. (2021) · Acta Neuropsychiatrica · doi:10.1017/neu.2021.22 · Cited by 17 · see citing works
Flagged first, then by citations
Cited by
Sorted by citations
Predicting Diagnostic Progression to Schizophrenia or Bipolar Disorder via Machine Learning
Hansen, L., Bernstorff, M., Enevoldsen, K., Kolding, S., Damgaard, J. G., Perfalk, E., Nielbo, K. L., Danielsen, A. A., & Østergaard, S. D. (2025) · JAMA Psychiatry · doi:10.1001/jamapsychiatry.2024.4702 · Cited by 34 · see citing works
Bernstorff, M., Hansen, L., Enevoldsen, K., Damgaard, J. G., Hæstrup, F., Perfalk, E., Danielsen, A. A., & Østergaard, S. D. (2024) · Acta Psychiatrica Scandinavica · doi:10.1111/acps.13687 · Cited by 22 · see citing works
“22 The dataset contains many predictors which did not have values within the lookbehind window.”
Perfalk, E., Damgaard, J. G., Bernstorff, M., Hansen, L., Danielsen, A. A., & Østergaard, S. D. (2024) · Psychological Medicine · doi:10.1017/s0033291724002642 · Cited by 12 · see citing works
Predicting cardiovascular disease in patients with mental illness using machine learning
Bernstorff, M., Hansen, L., Olesen, K. K. W., Danielsen, A. A., & Østergaard, S. D. (2025) · European Psychiatry · doi:10.1192/j.eurpsy.2025.1 · Cited by 6 · see citing works
“Thesepredictorswereaggregatedoverthelookbehindwindows (90,365,and730)days,toincorporatedifferenttemporalcontexts, andwithdifferentaggregationmethods(min,mean,andmax)using thetimeseriesflattenerpythonpackage[22],resultinginatotalof 234 potential predictors (Figure 1F).”
Parviz, M., Brieghel, C., Werling, M., Lacoppidan, T., Rotbain, E. C., Niemann, C. U., & Agius, R. (2026) · Acta Oncologica · doi:10.2340/1651-226x.2026.44569 · Cited by 1 · see citing works
“Feature extraction from timeseries data was performed using the timeseriesflattener Python package [29].”
Werling, M., Fuglkjær, A. D., Brown, P., Niemann, C. U., & Agius, R. (2026) · HemaSphere · doi:10.1002/hem3.70336 · Cited by 1 · see citing works
“We accounted for the irregular time series of EHR data by using the timeseriesflattener framework 28 to aggregate predictors within different lookback windows before initiation of first ‐ line treatment.”
Hansen, L. B. P., Bernstorff, M., Enevoldsen, K., Kolding, S., Damgaard, J. G., Perfalk, E., Nielbo, K. L., Danielsen, A. A., & Østergaard, S. D. (2024) · Neuroscience Applied · doi:10.1016/j.nsa.2024.104420 · Cited by 1 · see citing works
Hansen, L., Damgaard, J. G., Lundin, R. M., Danielsen, A. A., & Østergaard, S. D. (2025) · medRxiv · doi:10.1101/2025.06.19.25329678 · Cited by 1 · see citing works
Kolding, S., Damgaard, J. G., Bernstorff, M., Hansen, L., Østergaard, S. D., & Danielsen, A. A. (2026) · Nordic Journal of Psychiatry · doi:10.1080/08039488.2026.2716241
“Multiple values within a lookbehind window were condensed to a single summary statistic using specified aggregation functions (e.g. minimum value, mean value, etc.) using the timeseriesflattener v.2.0.1 Python package [34] (Figure 1F).”
InfluentialPerfalk, E., Damgaard, J. G., Danielsen, A. A., & Østergaard, S. D. (2026) · Schizophrenia Research · doi:10.1016/j.schres.2026.08.029
- Authors
- Bernstorff, M., Enevoldsen, K., Damgaard, J., Danielsen, A., & Hansen, L.
- Affiliations
- Aarhus University Hospital (DK)
- Aarhus University (DK)
- Venue
- Journal of Open Source Software
- Publisher
- The Open Journal
- Published
- 2023-03-29
- Volume
- 8
- Issue
- 83
- Pages
- 5197
- ISSN
- 2475-9066 (ISSN-L)
- OpenAlex
- W4361284142
- Cited by
- 10
- References
- 10
- Citations by year
- 2026: 4 · 2025: 3 · 2024: 3
- Type
- software paper
- Language
- en
- Open access
- diamond
- doi.org
- Licence
- Locations
- The Journal of Open Source Software (publishedVersion, cc-by)
- Funders
- Kræftens Bekæmpelse (R283‐A16461)
- Lundbeckfonden (R344‐2020‐1073, R283-A16461)
- Region Midtjylland
- H. Lundbeck A/S
- Topics
- Physical Sciences › Computer Science › Artificial Intelligence › Machine Learning in Healthcare
- Physical Sciences › Computer Science › Signal Processing › Time Series Analysis and Forecasting
- Health Sciences › Health Professions › Health Information Management › Artificial Intelligence in Healthcare
- Keywords
- irregularly sampled time series, electronic health records, time series summarization, missing data, Python library
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review