Skip to main content

The Finite-Interval Forecasting Engine (FIFE) provides machine learning and other models for discrete-time survival analysis and multivariate time series forecasting.

Suppose you have a dataset that looks like this:

ID period feature_1 feature_2 feature_3 ...
0 2019 7.2 A 2AX ...
0 2020 6.4 A 2AX ...
0 2021 6.6 A 1FX ...
0 2022 7.1 A 1FX ...
1 2019 5.3 B 1RM ...
1 2020 5.4 B 1RM ...
2 2020 6.7 A 1FX ...
2 2021 6.9 A 1RM ...
2 2022 6.9 A 1FX ...
3 2020 4.3 B 2AX ...
3 2021 4.1 B 2AX ...
4 2022 7.4 B 1RM ...
... ... ... ... ... ...

The entities with IDs 0, 2, and 4 are observed in the dataset in 2022.

  • What are each of their probabilities of being observed in 2023? 2024? 2025?
  • Given that they will be observed, what will be the value of feature_1? feature_3?
  • Suppose entities can exit the dataset under a variety of circumstances. If entities 0, 2, or 4 exit in a given year, what will their circumstances be?
  • How reliable can we expect these forecasts to be?
  • How do the values of the features inform these forecasts?

FIFE can estimate answers to these questions for any unbalanced panel dataset.

FIFE unifies survival analysis (including competing risks) and multivariate time series analysis. Tools for the former neglect future states of survival; tools for the latter neglect the possibility of discontinuation. Traditional forecasting approaches for each, such as proportional hazards and vector autoregression (VAR), respectively, impose restrictive functional forms that limit forecasting performance. FIFE supports the state-of-the-art approaches for maximizing forecasting performance: gradient-boosted trees (using LightGBM) and neural networks (using Keras).

FIFE is simple to use:

from fife.processors import PanelDataProcessor
from fife.lgb_modelers import LGBSurvivalModeler
import pandas as pd

data_processor = PanelDataProcessor(data=pd.read_csv(path_to_your_data))
data_processor.build_processed_data()

modeler = LGBSurvivalModeler(data=data_processor.data)
modeler.build_model()

forecasts = modeler.forecast()

Want to forecast future states, too? Just replace LGBSurvivalModeler with LGBStateModeler and specify the column you'd like to forecast with the state_col argument.

Want to forecast circumstances of exit ("competing risks")? Try LGBExitModeler with the exit_col argument instead.

Here's a guided example notebook with real data, where we forecast when world leaders will lose power.

You can read the documentation for FIFE here.

Metadata

Release files for fife 1.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fife 1.6.2
File Size Uploaded
fife-1.6.2.tar.gz 52.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fife 1.6.2
File Interpreter ABI Platform
fife-1.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 103.2 kB

Release files / fife-1.6.2.tar.gz

Download URL fife-1.6.2.tar.gz
Size 52.6 kB
Tags Source
SHA-256 checksum
How to use checksums
da0b53437a3fdb65e47e2d1719075d367783ca22dab2867b2759daea581fd54e
BLAKE2b-256 checksum
How to use checksums
b8b9a3296e91b8a578a3ac19ad20b6eb2f8fa791a9bda9dd00a458370196c6df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / fife-1.6.2-py3-none-any.whl

Download URL fife-1.6.2-py3-none-any.whl
Size 50.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2ac2946ac6ce2e4c1425dd3e5a8bd5d1f89f6ff711fad91ca73cb876db33043
BLAKE2b-256 checksum
How to use checksums
1ea2ca88ec323551ded870fb6525e7f3dcc633f62fdb1a99f8bb625e71ff6669
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release history Release notifications | RSS feed

This release

1.6.2 This release

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page