Package: greykite
﻿Greykite: A flexible, intuitive and fast forecasting and anomaly detection libraryWhy Greykite?The Greykite library provides flexible, intuitive and fast forecasts through its flagship algorithm, Silverkite.Silverkite algorithm works well on most time series, and is especially adept for those with changepoints in trend or seasonality,
event/holiday effects, and temporal dependencies.
Its forecasts are interpretable and therefore useful for trusted decision-making and insights.The Greykite library provides a framework that makes it easy to develop a good forecast model,
with exploratory data analysis, outlier/anomaly preprocessing, feature extraction and engineering, grid search,
evaluation, benchmarking, and plotting.
Other open source algorithms can be supported through Greykite’s interface to take advantage of this framework,
as listed below.Greykite AD (Anomaly Detection) is an extension of the Greykite Forecasting library. It provides users with an interpretable,
fast, robust and easy to use interface to monitor their metrics with minimal effort.Greykite AD improves upon the out-of-box confidence intervals generated by Silverkite, by automatically tuning the confidence intervals
and other filters (e.g. based onAPE) using expected alert rate information and/ or anomaly labels, if available.
It allows the users to define robust objective function, constraints and parameter space to optimize the confidence intervals.
For example user can target a minimal recall level of 80% while maximizing precision. Additionally, the users can specify a
minimum error level to filter out anomalies that are not business relevant. The motivation to include criteria other than
statistical significance is to bake in material/ business impact into the detection.For a demo, please see ourquickstart.Distinguishing FeaturesFlexible designProvides time series regressors to capture trend, seasonality, holidays,
changepoints, and autoregression, and lets you add your own.Fits the forecast using a machine learning model of your choice.Intuitive interfaceProvides powerful plotting tools to explore seasonality, interactions, changepoints, etc.Provides model templates (default parameters) that work well based on
data characteristics and forecast requirements (e.g. daily long-term forecast).Produces interpretable output, with model summary to examine individual regressors,
and component plots to visually inspect the combined effect of related regressors.Fast training and scoringFacilitates interactive prototyping, grid search, and benchmarking.
Grid search is useful for model selection and semi-automatic forecasting of multiple metrics.Extensible frameworkExposes multiple forecast algorithms in the same interface,
making it easy to try algorithms from different libraries and compare results.The same pipeline provides preprocessing, cross-validation,
backtest, forecast, and evaluation with any algorithm.Algorithms currently supported within Greykite’s modeling framework:Silverkite (Greykite’s flagship algorithm)Greykite Anomaly Detection (Greykite’s flagship anomaly detection algorithm)Facebook ProphetAuto ArimaNotable ComponentsGreykite offers components that could be used within other forecasting
libraries or even outside the forecasting context.ModelSummary() - R-like summaries ofscikit-learnandstatsmodelsregression models.ChangepointDetector() - changepoint detection based on adaptive lasso, with visualization.SimpleSilverkiteForecast() - Silverkite algorithm withforecast_simpleandpredictmethods.SilverkiteForecast() - low-level interface to Silverkite algorithm withforecastandpredictmethods.ReconcileAdditiveForecasts() - adjust a set of forecasts to satisfy inter-forecast additivity constraints.GreykiteDetector() - simple interface for optimizing anomaly detection performance based on Greykite forecasts.Usage ExamplesYou can obtain forecasts with only a few lines of code:fromgreykite.common.data_loaderimportDataLoaderfromgreykite.framework.templates.autogen.forecast_configimportForecastConfigfromgreykite.framework.templates.autogen.forecast_configimportMetadataParamfromgreykite.framework.templates.forecasterimportForecasterfromgreykite.framework.templates.model_templatesimportModelTemplateEnum# Defines inputsdf=DataLoader().load_bikesharing().tail(24*90)# Input time series (pandas.DataFrame)config=ForecastConfig(metadata_param=MetadataParam(time_col="ts",value_col="count"),# Column names in `df`model_template=ModelTemplateEnum.AUTO.name,# AUTO model configurationforecast_horizon=24,# Forecasts 24 steps aheadcoverage=0.95,# 95% prediction intervals)# Creates forecastsforecaster=Forecaster()result=forecaster.run_forecast_config(df=df,config=config)# Accesses resultsresult.forecast# Forecast with metrics, diagnosticsresult.backtest# Backtest with metrics, diagnosticsresult.grid_search# Time series CV resultresult.model# Trained modelresult.timeseries# Processed time series with plotting functionsFor a demo, please see ourquickstart.Setup and InstallationGreykite is available on Pypi and can be installed with pip:pip install greykiteFor more installation tips, seeinstallation.DocumentationPlease find our full documentationhere.Learn MoreWebsitePaper(KDD ‘22 Best Paper Runner-up, Applied Data Science Track)Blog postCitationPlease cite Greykite in your publications if it helps your research:@misc{reza2021greykite-github,
  author = {Reza Hosseini and
            Albert Chen and
            Kaixu Yang and
            Sayan Patra and
            Yi Su and
            Rachit Arora},
  title  = {Greykite: a flexible, intuitive and fast forecasting library},
  url    = {https://github.com/linkedin/greykite},
  year   = {2021}
}@inproceedings{reza2022greykite-kdd,
  author = {Hosseini, Reza and Chen, Albert and Yang, Kaixu and Patra, Sayan and Su, Yi and Al Orjany, Saad Eddin and Tang, Sishi and Ahammad, Parvez},
  title = {Greykite: Deploying Flexible Forecasting at Scale at LinkedIn},
  year = {2022},
  isbn = {9781450393850},
  publisher = {Association for Computing Machinery},
  address = {New York, NY, USA},
  url = {https://doi.org/10.1145/3534678.3539165},
  doi = {10.1145/3534678.3539165},
  booktitle = {Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  pages = {3007–3017},
  numpages = {11},
  keywords = {forecasting, scalability, interpretable machine learning, time series},
  location = {Washington DC, USA},
  series = {KDD '22}
}LicenseCopyright (c) LinkedIn Corporation. All rights reserved. Licensed under theBSD 2-ClauseLicense.