Skip to main content

Data, Model, and Algorithm Cards for Time Series

Project description

cardtale

PyPi Version GitHub Downloads

cardtale is a Python package for generating automated model and data cards for time series, streamlining the documentation process for machine learning models and datasets.

Key Features

  • Automated generation of PDF reports with comprehensive time series analysis
  • Built-in statistical analysis and visualization of temporal patterns
  • Support for univariate time series data (will support other structures in future iterations)

Each time series is studied from multiple dimensions, including:

  • Data Overview: Fundamental characteristics and statistical properties analysis
  • Trend Analysis: Long-term growth patterns and level stabilization assessment
  • Seasonality Detection: Multiple seasonality levels with strength metrics
  • Variance Analysis: Heteroskedasticity testing and variance stabilization methods
  • Change Point Detection: Identification of structural changes and regime shifts

Basic Example

Here's a basic example of cardtale.

from datasetsforecast.m3 import M3
from cardtale.cards.builder import CardsBuilder

df, *_ = M3.load('./assets', group='Monthly')

freq = 'ME'
uid = 'M1080'

series_df = df.query(f'unique_id=="{uid}"').reset_index(drop=True)

tcard = CardsBuilder(series_df, freq)
tcard.build_cards()
tcard.get_pdf(path='examples/cards/example.pdf')

Screenshots

trend

trend2

seas

seas2

var

change

⚠️ WARNING

cardtale is in the early stages of development. It is designed to cover datasets containing single univariate time series, focusing on forecasting tasks.

cardtale has been developed for monthly time series. So, the output for other frequencies may not be as reliable. Especially time series with complex seasonality.

If you encounter any issues, please report them in GitHub Issues

Installation

Prerequisites

Required dependencies:

arch==7.1.0
pandas==2.2.3
lightgbm==4.5.0
neuralforecast==1.7.5
mlforecast==0.13.4
statsforecast==1.7.8
datasetsforecast==0.0.8
numerize==0.12
plotnine==0.13.6
statsmodels==0.14.4
jinja2==3.1.4
ruptures==1.1.9
weasyprint==62.3

You can install cardtale using pip:

pip install cardtale

[Optional] Installation from source

To install cardtale from source, clone the repository and run the following command:

git clone https://github.com/vcerqueira/cardtale
pip install -e cardtale

License

Cardtale is released under the MIT License. See the LICENSE file for more details.

Mission

In the machine learning lifecycle, proper documentation of models and datasets is crucial for transparency, reproducibility, and responsible AI practices. However, creating comprehensive model and data cards can be time-consuming. The Python package cardtale aims to partially automate this process, making it more efficient and consistent.

The goal of cardtale is to generate a set of analyses, visualizations, and interpretations based on input model metrics and dataset characteristics. While it doesn't replace the expertise of data scientists or domain experts, Cardtale speeds up the creation of model and data cards, guiding analysts towards key insights and areas that may require further exploration.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cardtale-0.1.0.tar.gz (6.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cardtale-0.1.0-py3-none-any.whl (88.8 kB view details)

Uploaded Python 3

File details

Details for the file cardtale-0.1.0.tar.gz.

File metadata

  • Download URL: cardtale-0.1.0.tar.gz
  • Upload date:
  • Size: 6.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for cardtale-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e3cd71601716d32886be98551cb58ac6604d094f539be6ddad30589dccb3ccc3
MD5 9bd936feabc378ff72779b957b83d85f
BLAKE2b-256 cac66cad34746d403723944a2954dbc3dd3a4146ce87a21cc1b17a3a6f1ad1eb

See more details on using hashes here.

File details

Details for the file cardtale-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cardtale-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 88.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for cardtale-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a89fe75ca76458d18378b67f300f8f4d5822f5e089c04afcf9868601c8406b2d
MD5 f827ef46f8848c92832fb5726d470643
BLAKE2b-256 b93d82a6d5913edd0a1f68de0100bf0c2ee52625f319e728b9363b7dbfb24c20

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page