Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.6%) to scientific vocabulary
Repository
Calendar generator for machine learning with timeseries data
Basic Info
- Host: GitHub
- Owner: AI4S2S
- License: apache-2.0
- Language: Python
- Default Branch: main
- Homepage: https://lilio.readthedocs.io/en/latest/
- Size: 8.56 MB
Statistics
- Stars: 5
- Watchers: 4
- Forks: 1
- Open Issues: 8
- Releases: 6
Metadata Files
README.md
lilio: Calendar generator for machine learning with timeseries data

A python package for generating calendars to resample timeseries into training and target data for machine learning. Named after the inventor of the Gregorian Calendar.
Lilio was originally designed for use in s2spy, a high-level python package integrating expert knowledge and artificial intelligence to boost (sub) seasonal forecasting.
Installation
To install the latest release of lilio, do:
console
python3 -m pip install lilio
Lilio is also available on conda-forge. If you use conda, do:
console
conda install -c conda-forge lilio
To install the in-development version from the GitHub repository, do:
console
python3 -m pip install git+https://github.com/AI4S2S/lilio.git
Configure the package for development and testing
A more extensive developer guide can be found here.
The testing framework used here is pytest. Before running the test, we get a local copy of the source code and install lilio via the command:
py
git clone https://github.com/AI4S2S/lilio.git
cd lilio
python3 -m pip install -e .[dev]
Then, run tests:
py
hatch run test
How the lilio calendars work
In Lilio, calendars are 2-dimensional. Each row (year) represents a unique observation, whereas each column corresponds to a precursor period with a certain lag. This is how we like to structure our data for ML applications.

We define the "anchor date" to be between the target and precursor periods (strictly speaking, it is the start of the first target interval). All other intervals are expressed as offsets to this anchor date. Conveniently, this eliminates any ambiguity related to leap years.
Here's a calendar generated with Lilio:
```py
calendar = lilio.dailycalendar(anchor="11-30", length='180d') calendar = calendar.mapyears(2020, 2021) calendar.show() iinterval -1 1 anchoryear 2021 [2021-06-03, 2021-11-30) [2021-11-30, 2022-05-29) 2020 [2020-06-03, 2020-11-30) [2020-11-30, 2021-05-29) ```
Now, the user can load the data input_data (e.g. pandas DataFrame) and resample it to the desired timescales configured in the calendar:
```py
calendar = calendar.maptodata(inputdata) bins = lilio.resample(calendar, inputdata) bins anchoryear iinterval interval mean_data target 0 2020 -1 [2020-06-03, 2020-11-30) 275.5 True 1 2020 1 [2020-11-30, 2021-05-29) 95.5 False 2 2021 -1 [2021-06-03, 2021-11-30) 640.5 True 3 2021 1 [2021-11-30, 2022-05-29) 460.5 False ```
For convenience, Lilio offers a few shorthands for standard of calendars e.g.
monthly_calendar
and
weekly_calendar.
However, you can also create custom calendars by calling
Calendar
directly. For a nice walkthrough, see this example
notebook.
Documentation
For detailed information on using lilio package, visit the documentation page hosted at Readthedocs.
Contributing
If you want to contribute to the development of lilio, have a look at the contribution guidelines.
How to cite us
Please use the Zenodo DOI to cite this package if you used it in your research.
Acknowledgements
This package was developed by the Netherlands eScience Center and Vrije Universiteit Amsterdam under Netherlands eScience Center grant NLESC.OEC.2021.005.
The package was created with Cookiecutter and the NLeSC/python-template.
Owner
- Name: AI4S2S
- Login: AI4S2S
- Kind: organization
- Repositories: 3
- Profile: https://github.com/AI4S2S
Citation (CITATION.cff)
# YAML 1.2
---
cff-version: "1.1.0"
title: "lilio: Calendar generator for machine learning with timeseries data"
authors:
-
family-names: Liu
given-names: Yang
orcid: "https://orcid.org/0000-0002-1966-8460"
affilication: "Netherlands eScience Center"
-
family-names: Kalverla
given-names: Peter
orcid: "https://orcid.org/0000-0002-5025-7862"
affiliation: "Netherlands eScience Center"
-
family-names: Schilperoort
given-names: Bart
orcid: "https://orcid.org/0000-0003-4487-9822"
affiliation: "Netherlands eScience Center"
-
family-names: Vijverberg
given-names: Sem
orcid: "https://orcid.org/0000-0002-1839-2618"
affiliation: "Vrije Universiteit Amsterdam"
-
family-names: van Ingen
given-names: Jannes
affiliation: "Vrije Universiteit Amsterdam"
-
family-names: Alidoost
given-names: Fakhereh
orcid: "https://orcid.org/0000-0001-8407-6472"
affiliation: "Netherlands eScience Center"
-
family-names: Donnelly
given-names: Claire
orcid: "https://orcid.org/0000-0002-2546-4528"
affiliation: "Netherlands eScience Center"
version: "0.5.0"
repository-code: "https://github.com/AI4S2S/lilio"
keywords:
- calendar
- calendar generation
- calendar maker
- machine learning
- timeseries analysis
message: "If you use this software, please cite it using these metadata."
license: Apache-2.0
GitHub Events
Total
Last Year
Packages
- Total packages: 1
-
Total downloads:
- pypi 20 last-month
- Total dependent packages: 1
- Total dependent repositories: 1
- Total versions: 7
- Total maintainers: 4
pypi.org: lilio
python package for generating calendars for machine learning timeseries analysis.
- Documentation: https://lilio.readthedocs.io/
- License: Apache Software License
-
Latest release: 0.5.0
published about 2 years ago