merlion: Time Series Intelligence
merlion
is a Python library for time series intelligence. We support the following key features,
each associated with its own sub-package:
merlion.models
: A library of models unified under a single shared interface, with specializations for anomaly detection and forecasting. More specifically, we havemerlion.models.defaults
: Default models for anomaly detection and forecasting. These are good models for getting started.merlion.models.anomaly
: Anomaly detection modelsmerlion.models.anomaly.change_point
: Change point detection modelsmerlion.models.forecast
: Forecasting models, including those which support exogenous regressorsmerlion.models.anomaly.forecast_based
: Forecasting models adapted for anomaly detection. Anomaly scores are based on the residual between the predicted and true value at each timestamp.merlion.models.ensemble
: Ensembles & automated model selection of models for both anomaly detection and forecasting.merlion.models.automl
: AutoML layers for various models
merlion.dashboard
: A GUI dashboard app for Merlion, which can be started withpython -m merlion.dashboard
. This dashboard provides a good way to quickly experiment many models on a new time series.merlion.spark
: APIs to integrate Merlion with PySpark for using distributed computing to run training and inference on multiple time series in parallel.merlion.transform
: Data pre-processing layer which implements many standard data transformations used in time series analysis. Transforms are callable objects, and each model has its own configurablemodel.transform
which it uses to pre-process all input time series for both training and inference.merlion.post_process
: Post-processing rules to apply on the output of a model. Currently, these are specific to anomaly detection, and includemerlion.post_process.calibrate
: Rules to calibrate the anomaly scores returned by a model, to be interpretable as z-scores, i.e. as standard deviations of a standard normal random variable. Each anomaly detection model has amodel.calibrator
from this module, which can optionally be applied to ensure that the model’s anomaly scores are calibrated.merlion.post_process.threshold
: Rules to reduce the noisiness of an anomaly detection model’s outputs. Each anomaly detection model has amodel.threshold
from this module, which can optionally be applied to filter the model’s predicted sequence of anomaly scores.
merlion.evaluate
: Evaluation metrics & pipelines to simulate the live deployment of a time series model for any task.merlion.plot
: Automated visualization of model outputs for univariate time seriesmerlion.utils
: Various utilities, including theTimeSeries
class, resampling functions, Bayesian conjugate priors, reconciliation for hierarchical time series, and more.
The key classes for input and output are merlion.utils.time_series.TimeSeries
and
merlion.utils.time_series.UnivariateTimeSeries
. Notably, these classes have transparent inter-operability
with pandas.DataFrame
and pandas.Series
, respectively. Check this tutorial
for some examples on how to use these classes, or the API docs linked above for a full list of features.
The full API documentation is outlined below:
- merlion.models package
- Subpackages
- anomaly
- anomaly.change_point
- anomaly.forecast_based
- forecast
- ensemble
- automl
- utils
- defaults
- factory
- base
Config
NormalizingConfig
ModelBase
ModelBase.filename
ModelBase.config_class
ModelBase.train_data
ModelBase.reset()
ModelBase.base_model
ModelBase.require_even_sampling
ModelBase.require_univariate
ModelBase.auto_align
ModelBase.supports_exog
ModelBase.dim
ModelBase.transform
ModelBase.timedelta
ModelBase.last_train_time
ModelBase.train_pre_process()
ModelBase.transform_time_series()
ModelBase.train()
ModelBase.train_post_process()
ModelBase.save()
ModelBase.load()
ModelBase.to_bytes()
ModelBase.from_bytes()
MultipleTimeseriesModelMixin
- deep_base
- layers
- Subpackages
- merlion.dashboard package
- merlion.spark package
- merlion.transform package
- merlion.post_process package
- merlion.evaluate package
- merlion.plot package
- merlion.utils package