Skip to main content

A stable version of the tfcasualimpact package

Project description

tfp_causalimpact_customized

Features

Highlighting Missing Post-Intervention Observations:

In scenarios where no observed data exist for certain time points within the post-intervention period, the forecasted values are still computed by the model but cannot be validated against observed outcomes. To visually distinguish these points in the plots, we highlight them differently (e.g., using a dashed line and a separate color). This approach ensures that readers can easily identify which portions of the forecast are based purely on model inference (no ground-truth observations available) and which are directly comparable to actual observed data. This visual cue can be critical for interpreting the reliability and meaning of the estimated causal effects during periods with missing observations.

Improved summary round to 3 digits

Matplotlib Japanese Support

  • Added support for Japanese fonts and characters in Matplotlib plots.
  • Enhanced compatibility with Japanese data visualization requirements.

Improved Matplotlib Plots

  • Enhanced plotting capabilities for clearer and more informative visualizations.
  • Customized plot styles and themes to better represent causal impact analysis.

Comparison with tfcausalimpact

Enhancements Over tfcausalimpact

  • Stability: Resolved the issue of results changing from run to run, ensuring consistent outcomes. See Result change from run to run in tfcausalimpact.
  • Performance: Optimized performance for faster computations and larger datasets.
  • Customization: Increased flexibility in model customization and parameter tuning.

Fixed Issues

Getting Started

  1. Installation
    uv add tfp_causalimpact_customized
    
  2. Plot options (Currently only Matplotlib is supported) Important:y_formatter_unit must be a dictionary with the keys that are the same as legend_labels y_labels.
plot_options = {
    'chart_width': 1000,
    'chart_height': 200,
    'x_label': 'Date',
    'y_labels': ['Observed1', 'Pointwise Effect1', 'Cumulative Effect1'],
    'title': 'Customized Matplotlib Plot',
    'title_font_size': 16,
    'axis_title_font_size': 14,
    'y_formatter': 'millions',
    'y_formatter_unit': {
        'Observed1': ' units',
        'Pointwise Effect1': ' effect',
        'Cumulative Effect1': ' total'
    },
    'legend_labels': {
        'mean': 'Average',
        'observed': 'Observed',
        'pointwise': 'Pointwise Effect',
        'cumulative': 'Cumulative Effect',
        'pre-period-start': 'Start of Pre-Period',
        'pre-period-end': 'End of Pre-Period',
        'post-period-start': 'Start of Post-Period',
        'post-period-end': 'End of Post-Period'
    }
}

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

tfp_causalimpact_customized-0.1.36.tar.gz (3.0 MB view details)

Uploaded Source

Built Distribution

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

tfp_causalimpact_customized-0.1.36-py3-none-any.whl (62.2 kB view details)

Uploaded Python 3

File details

Details for the file tfp_causalimpact_customized-0.1.36.tar.gz.

File metadata

File hashes

Hashes for tfp_causalimpact_customized-0.1.36.tar.gz
Algorithm Hash digest
SHA256 6f63e476e3874cefa40015a5cb8f16bf0c0bfa589ac967111f2eef2343d839ac
MD5 2506e3e07317eb29fa0a6684151cf5ad
BLAKE2b-256 1de7073b040bc2aa860056704ec048389fdd1d5e692b32b41064878bb10dbcdb

See more details on using hashes here.

File details

Details for the file tfp_causalimpact_customized-0.1.36-py3-none-any.whl.

File metadata

File hashes

Hashes for tfp_causalimpact_customized-0.1.36-py3-none-any.whl
Algorithm Hash digest
SHA256 53c7b56bc4ff317b49370c886e10766f3fb9a9f2cb16184d5a430bc1c1e6f82e
MD5 84d2211093b52b552e0a8f735897a988
BLAKE2b-256 93e38b0dae07c737761658bc8423a8ab90513acca904063bed73c3c5159e4e20

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