Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/linkedin/greykite
/ functions
Functions
2,034 in github.com/linkedin/greykite
⨍
Functions
2,034
◇
Types & classes
151
↳
Endpoints
13
↓ 4 callers
Method
transform_evaluate
Transforms and evaluates on test data. Must call ``fit`` before calling this method. forecasts_test : `pandas.DataFrame`
greykite/algo/reconcile/convex/reconcile_forecasts.py:1436
↓ 4 callers
Method
validate_fs_components_df
Validates the inputs of a fourier series components dataframe called by ``SilverkiteEstimator`` to validate the input ``fs_components_df``.
greykite/sklearn/estimator/silverkite_estimator.py:280
↓ 3 callers
Method
_drop_incomplete_agg
Drops aggregations with incomplete periods. For example, a daily aggregation of hourly data will have a biased aggregation if the data starts
greykite/sklearn/estimator/multistage_forecast_estimator.py:522
↓ 3 callers
Function
add_event_window
For a data frame of events with a time_col and label_col it adds shifted events prior and after the given events For example i
greykite/common/features/timeseries_features.py:871
↓ 3 callers
Method
apply_lag_based_model_components_defaults
Fills the default values to ``model_components`` if not provided. Parameters ---------- model_components : :class:`~greykite.
greykite/framework/templates/lag_based_template.py:74
↓ 3 callers
Method
apply_template_for_pipeline_params
Explicitly calls the method in `~greykite.framework.templates.base_template.BaseTemplate` to make use of the decorator in this class.
greykite/framework/templates/silverkite_template.py:665
↓ 3 callers
Method
apply_template_for_pipeline_params
Explicitly calls the method in `~greykite.framework.templates.base_template.BaseTemplate` to make use of the decorator in this class.
greykite/framework/templates/prophet_template.py:583
↓ 3 callers
Function
build_anomaly_percent_reward
This builds an reward function given an expected anomaly percent range. This is the expected percent of anomalies in the data by user. This is
greykite/detection/detector/detector.py:52
↓ 3 callers
Function
calc_quantiles_simulated_df
Calculates quantiles corresponding to probs by simulating time series with specified parameters :param sim_df_func: callable a function wh
greykite/common/testing_utils_anomalies.py:119
↓ 3 callers
Function
compare_two_dfs_on_index
Calculates difference between two dataframes macthed on a given index. One intended application is to compare breakdown dfs from two related ML mo
greykite/common/compare_two_dfs_on_index.py:28
↓ 3 callers
Function
elementwise_within_bands
Whether ``true_val`` is strictly between ``lower_val`` and ``upper_val``. Parameters ---------- true_val : float True value.
greykite/common/evaluation.py:850
↓ 3 callers
Function
estimate_seasonality_with_detected_changepoints
Estimates the seasonality effect with detected change points. Parameters ---------- df : `pandas.DataFrame` The data df. time
greykite/algo/changepoint/adalasso/changepoints_utils.py:1173
↓ 3 callers
Method
find_shifts
This is the main function to detect level shifts based on the z score threshold. Attributes ---------- df : `pandas.DataFrame
greykite/algo/changepoint/shift_detection/shift_detector.py:267
↓ 3 callers
Function
fit_silverkite
(autoreg_dict)
greykite/tests/algo/forecast/silverkite/test_forecast_silverkite.py:3141
↓ 3 callers
Method
fit_transform_evaluate
Fits, transforms, and evaluates on training data. Parameters ---------- forecasts : `pandas.DataFrame` Forecasts
greykite/algo/reconcile/convex/reconcile_forecasts.py:1408
↓ 3 callers
Function
forecast_similarity_based
Fits a basic forecast model which is aggregate based. As an example for an hourly time series we can assign the value of the most recent three wee
greykite/algo/forecast/similarity/forecast_similarity_based.py:33
↓ 3 callers
Function
generate_anomaly_blocks
Returns blocks of indices to insert anomalies into. :param timeseries_length: int length of the time series into which we want to inject
greykite/common/testing_utils_anomalies.py:32
↓ 3 callers
Function
generate_anomaly_data
Generates dataset for anomaly detection unit tests. Parameters ---------- freq: `str` Frequency of the dataset. periods: `int
greykite/detection/common/testing_utils.py:36
↓ 3 callers
Function
get_auto_growth
Automatically gets the parameters for growth. Parameters ---------- df : `pandas.DataFrame` The input time series. time_col :
greykite/algo/forecast/silverkite/auto_config.py:203
↓ 3 callers
Function
get_available_holiday_lookup_countries
Returns list of available countries for modeling holidays :param countries: List[str] only look for available countries in this set :
greykite/common/features/timeseries_features.py:655
↓ 3 callers
Function
get_available_holidays_across_countries
Returns a list of holidays that occur any of the countries between the years specified. :param countries: List[str] countries for whi
greykite/common/features/timeseries_features.py:692
↓ 3 callers
Function
get_best_index
Suitable for use as the `refit` parameter to `~sklearn.model_selection.RandomizedSearchCV`, after wrapping with `functools.partial`. Call
greykite/framework/pipeline/utils.py:63
↓ 3 callers
Function
get_cardinality_factor
Cardinalty factor used to penalize the overlap size & positional reward. Parameters ---------- overlap_count : array-like, 1-D Ac
greykite/detection/common/ad_evaluation_utils.py:97
↓ 3 callers
Function
get_changes_from_beta
Gets the seasonality magnitude change arrays for each seasonality component from the estimated regression coefficients. In total there are::
greykite/algo/changepoint/adalasso/changepoints_utils.py:936
↓ 3 callers
Method
get_forecast_time_properties
Returns forecast time parameters. Uses ``self.df``, ``self.config``, ``self.regressor_cols``. Available parameters: - s
greykite/framework/templates/base_template.py:194
↓ 3 callers
Function
get_fourier_feature_col_names
Gets the Fourier feature column names. Parameters ---------- df : `pandas.DataFrame` The input data. time_col : `str`
greykite/algo/forecast/silverkite/forecast_silverkite_helper.py:318
↓ 3 callers
Function
get_h_mat
Computes the H matrix given ``x_mat`` and ``alpha`` for linear and ridge regression. The formula is ``H = inv(X.T @ X + alpha * np.eye(p)) @ X.T``
greykite/algo/common/ml_models.py:349
↓ 3 callers
Method
get_hyperparameter_grid
Returns hyperparameter grid. Implements the method in `~greykite.framework.templates.base_template.BaseTemplate`. Uses ``self.time_p
greykite/framework/templates/silverkite_template.py:564
↓ 3 callers
Method
get_max_ar_order
Gets the maximum autoregression order. Returns ------- max_ar_order : `int` The maximum autoregression order.
greykite/sklearn/estimator/base_silverkite_estimator.py:554
↓ 3 callers
Function
get_model_results_summary
Generates model results summary. Parameters ---------- result : `ForecastResult` See :class:`~greykite.framework.pipeline.pipelin
docs/nbpages/tutorials/0300_weekly_data.py:136
↓ 3 callers
Function
get_seasonality_changepoints
Automatically detects seasonality change points. The function first converts changepoints_dict if "method" == "auto", then extracts trend cha
greykite/algo/changepoint/adalasso/changepoint_detector.py:1189
↓ 3 callers
Function
impute_with_lags_multi
Imputes every column of ``df`` using `~greykite.common.features.timeseries_impute.impute_with_lags`. Parameters ---------- df : `pand
greykite/common/features/timeseries_impute.py:124
↓ 3 callers
Function
l1_quantile_regression
Implements the quantile regression with penalty terms. Supports sample weight and feature weights in penalty. This is solved with linear prog
greykite/algo/common/l1_quantile_regression.py:120
↓ 3 callers
Method
load_beijing_pm_ts
Loads the Beijing Particulate Matter (PM2.5) dataset. https://archive.ics.uci.edu/ml/datasets/Beijing+PM2.5+Data This hourly data set
greykite/framework/benchmark/data_loader_ts.py:158
↓ 3 callers
Method
load_bikesharing_ts
Loads the Hourly Bike Sharing Count dataset. This dataset contains aggregated hourly count of the number of rented bikes. The data al
greykite/framework/benchmark/data_loader_ts.py:112
↓ 3 callers
Method
load_bitcoin_transactions
Loads the Daily Bitcoin Transactions dataset. This dataset contains the number of Bitcoin transactions from 2009 to 2021. The dataset
greykite/common/data_loader.py:453
↓ 3 callers
Method
load_data_ts
Loads dataset by name from the internal data library. Parameters ---------- data_name : `str` Dataset to load fro
greykite/framework/benchmark/data_loader_ts.py:214
↓ 3 callers
Function
ordinary_quantile_regression
Implements the quantile regression without penalty terms. Supports sample weight. Applies the iterative re-weighted least square (IRLS) algor
greykite/algo/common/l1_quantile_regression.py:44
↓ 3 callers
Function
params_components
Parameters for ``forecast_silverkite``
greykite/sklearn/estimator/testing_utils.py:34
↓ 3 callers
Method
plot_evaluation_metrics
Returns a barplot of the train and test values of ``metric_dict`` of ``config_names``. Value of a metric for all ``config_names`` are plotted
greykite/framework/benchmark/benchmark_class.py:487
↓ 3 callers
Method
plot_runtimes
Returns a barplot of the runtimes of ``config_names``. Parameters ---------- config_names : `list` [`str`], default None
greykite/framework/benchmark/benchmark_class.py:785
↓ 3 callers
Method
plot_trend_changepoint_detection
Convenience function to plot the original trend changepoint detection results. Parameters ---------- params : `dict` or `None
greykite/sklearn/estimator/base_silverkite_estimator.py:894
↓ 3 callers
Function
plt_annotate_series
A function which plots a values given in ``value_col`` of a dataframe ``df`` against x-axis values given in ``x_col`` and adds annotations based
greykite/common/viz/timeseries_annotate.py:38
↓ 3 callers
Function
plt_longterm_ts_agg
Make a longterm avg plot by taking the average in a window and moving that across the time. That window can be a week, month, year etc
greykite/common/viz/timeseries_plotting_mpl.py:283
↓ 3 callers
Method
predict
Creates forecast for dates specified in X The forecast one-by-one is supposed to forecast for the specified forecast horizon with the
greykite/sklearn/estimator/one_by_one_estimator.py:363
↓ 3 callers
Method
predict
Creates forecast for dates specified in X To enable caching, every subclass must call this at the beginning of its ``.predict()``. Be
greykite/sklearn/estimator/base_forecast_estimator.py:151
↓ 3 callers
Function
print_summary
Creates the content for printing the summary. Parameters ---------- info_dict : `dict` The output summary dictionary from
greykite/algo/common/model_summary_utils.py:1849
↓ 3 callers
Function
pytz_is_dst_fcn
For a given timezone, it constructs a function which determines if a timestamp (`dt`) is inside the daylight saving period or not for a list o
greykite/common/features/timeseries_features.py:83
↓ 3 callers
Method
remove_na
Removes NAs from the input series. Also, importantly, will raise error if there are not enough data left (at least 2). Parameters
greykite/common/features/outlier.py:238
↓ 3 callers
Method
run_forecast_json
Calls :func:`~greykite.framework.pipeline.pipeline.forecast_pipeline` according to the ``json_str`` configuration parameters. Paramet
greykite/framework/templates/forecaster.py:381
↓ 3 callers
Function
signed_pow_fcn
(y)
greykite/common/features/timeseries_features.py:1568
↓ 3 callers
Function
sim_anomalous_data_and_forecasts
This function construct normal data and injects anomalies into the data (returned in ``"df"`` item of the result). It also creates two
greykite/detection/common/testing_utils.py:160
↓ 3 callers
Function
simplify_changepoints
Simplifies a changepoint predictor name. Changes "changepoint" to "cp" to shorten the changepoint features' names. If ``cst.CHANGEPOINT_COL_P
greykite/algo/common/col_name_utils.py:94
↓ 3 callers
Function
simplify_pred_cols
Simplifies predictor names in a list. Parameters ---------- pred_cols : `list` [ `str` ] A list of predictor names to be simplifi
greykite/algo/common/col_name_utils.py:134
↓ 3 callers
Method
summary
Prints input parameters and Prophet model parameters. Returns ------- log_message : str log message printed to lo
greykite/sklearn/estimator/prophet_estimator.py:314
↓ 3 callers
Method
summary
Creates the model summary for the given model Parameters ---------- max_colwidth : `int` The maximum length for p
greykite/sklearn/estimator/base_silverkite_estimator.py:585
↓ 3 callers
Method
to_dict
(self)
greykite/framework/templates/autogen/forecast_config.py:289
↓ 3 callers
Method
transform
Replaces outliers with NaN. Parameters ---------- X : `pandas.DataFrame` Data to transform. e.g. each column is a
greykite/sklearn/transform/difference_based_outlier_transformer.py:184
↓ 3 callers
Method
transform
Normalizes data using the specified scaling method. Parameters ---------- X : `pandas.DataFrame` Data to transfor
greykite/sklearn/transform/normalize_transformer.py:117
↓ 3 callers
Function
unique_dict_in_list
Returns the unique dictionaries in the input list, preserving the original order. Replaces ``unique_elements_in_list`` because `dict` is not h
greykite/common/python_utils.py:145
↓ 2 callers
Method
__build_autoreg_features
Builds autoregressive df to be used in forecast models. Parameters ---------- df : `pandas.Dataframe` Dataframe t
greykite/algo/forecast/silverkite/forecast_silverkite.py:2957
↓ 2 callers
Method
__build_lagged_regressor_features
Builds lagged regressor df to be used in forecast models. Parameters ---------- df : `pandas.Dataframe` Dataframe
greykite/algo/forecast/silverkite/forecast_silverkite.py:3036
↓ 2 callers
Method
__decode_single_template
Given a single simple silverkite template's name, preprocess the name order and fill in default values. The naming of a simple silverkite tem
greykite/framework/templates/simple_silverkite_template.py:891
↓ 2 callers
Method
__evaluation_metrics
Computes various evaluation metrics for the forecast. :param data: pd.DataFrame with columns according to self.__init__ (e.g. sub
greykite/framework/output/univariate_forecast.py:190
↓ 2 callers
Method
__get_config_with_default_model_template_and_components
Gets config with default value for `model_template` and `model_components_param` if not provided. - model_template : default value is ``s
greykite/framework/templates/forecaster.py:121
↓ 2 callers
Method
__get_regressor_templates
Gets the model templates for each sub-model. These templates are for ``self.get_regressor_cols`` and ``self.get_lagged_regressor_info``
greykite/framework/templates/multistage_forecast_template.py:73
↓ 2 callers
Method
__get_seasonality_order_from_dataframe
Returns fourier series order from a `pandas.DataFrame` fourier series specification. Return value is capped by ``max_order``. Paramet
greykite/algo/forecast/silverkite/forecast_simple_silverkite.py:1049
↓ 2 callers
Method
__get_template_class
Extracts template class (e.g. `SimpleSilverkiteTemplate`) from the config. Currently only supports single templates in `~greykite.fram
greykite/framework/templates/multistage_forecast_template.py:548
↓ 2 callers
Method
__init__
( self, trim_percent=TRIM_PERCENT, diff_method=MOVING_MEDIAN)
greykite/common/features/outlier.py:188
↓ 2 callers
Method
__repr__
print method
greykite/algo/common/model_summary.py:97
↓ 2 callers
Method
__str__
Print method.
greykite/detection/detector/reward.py:222
↓ 2 callers
Method
__str__
print method.
greykite/algo/common/model_summary.py:92
↓ 2 callers
Method
_aggregate_values
Aggregates the ``df`` with the given ``agg_freq`` and applies the ``agg_func``. All columns whose names do not start with f"{time_col}__" wil
greykite/sklearn/estimator/multistage_forecast_estimator.py:567
↓ 2 callers
Method
_build_quantile_regression_features
Builds a default ``self.x_mat`` if it is not given. Currently the class does not support customizing the built feature matrix. The bu
greykite/sklearn/uncertainty/quantile_regression_uncertainty_model.py:216
↓ 2 callers
Method
_get_agg_dfs
Given a dataframe, training/fitting configuration, gets the training data and fit data. If training data include incomplete periods during ag
greykite/sklearn/estimator/multistage_forecast_estimator.py:685
↓ 2 callers
Method
_get_agg_func
Gets the aggregation function. Returns the input if it's None or a callable. Finds the corresponding callable from `~greykite
greykite/sklearn/estimator/multistage_forecast_estimator.py:374
↓ 2 callers
Method
_get_averaged_scores
Calculates the average score for each event date. Returns ------- result : `dict` [`str`, `float`] A dictionary w
greykite/algo/common/holiday_inferrer.py:544
↓ 2 callers
Method
_get_lasso_input
Computes the transformed Lasso input quantities. Parameters ---------- x : `numpy.array` The design matrix.
greykite/algo/common/partial_regularize_regression.py:557
↓ 2 callers
Method
_get_num_points_per_agg_freq
Gets the number of data points in a aggregation period. Parameters ---------- data_freq : `str` The data frequenc
greykite/sklearn/estimator/multistage_forecast_estimator.py:402
↓ 2 callers
Method
_get_predictions
Gets the lag based predictions. Parameters ---------- fut_df : `pandas.DataFrame` The input data that contains ``
greykite/sklearn/estimator/lag_based_estimator.py:369
↓ 2 callers
Method
_get_scores_for_holidays
Calculates the scores for a list of events, each with multiple occurrences. Returns ------- result : `dict` [`str`, `list` [`
greykite/algo/common/holiday_inferrer.py:520
↓ 2 callers
Method
_get_silverkite_ar_max_order
Gets the AR order so that the model can use ``past_df`` to generate AR terms instead of imputation. This function only applies to the Silverk
greykite/sklearn/estimator/multistage_forecast_estimator.py:813
↓ 2 callers
Method
_process_df
Does pre-processing which includes: - adjust trend (optional) - aggregation (optional) Parameters --
greykite/algo/common/seasonality_inferrer.py:599
↓ 2 callers
Method
_process_params
Checks and overrides the input parameters, and makes sure the values are valid. Parameters ---------- configs : `list` [`Seas
greykite/algo/common/seasonality_inferrer.py:342
↓ 2 callers
Function
add_category_cols
Adds indicators columns to coefficient summary df for categaries. Parameters ---------- coef_summary : `pandas.DataFrame` The coe
greykite/algo/common/col_name_utils.py:155
↓ 2 callers
Method
add_features
Adds features to `joined_dfs` passed. Note that if nothing is passed, this will update ``self.joined_dfs`` Parameters -------
greykite/detection/detector/forecast_based.py:159
↓ 2 callers
Function
add_time_features
(df)
greykite/algo/forecast/similarity/forecast_similarity_based.py:104
↓ 2 callers
Function
apply_method_defaults
Decorator for `greykite.algo.reconcile.convex.reconcile_forecasts.ReconcileAdditiveForecasts.fit`. Fetches parameters based on ``method`` and call
greykite/algo/reconcile/convex/reconcile_forecasts.py:205
↓ 2 callers
Method
apply_template_for_pipeline_params
Explicitly calls the method in `~greykite.framework.templates.base_template.BaseTemplate` to make use of the decorator in this class.
greykite/framework/templates/auto_arima_template.py:355
↓ 2 callers
Method
apply_template_for_pipeline_params
Implements template interface method. Takes input data and optional configuration parameters to customize the model. Returns a set of
greykite/framework/templates/base_template.py:289
↓ 2 callers
Function
benchmark_silverkite_template
Benchmarks silverkite template and returns the output as a list :param data_name: str Name of the dataset we are performing benchmarking
greykite/framework/benchmark/benchmark_template.py:37
↓ 2 callers
Method
calc_with_param
This is a calculation step which uses both ``data`` and ``param``. This is typically expected to be implemented by user. By default, i
greykite/detection/detector/optimizer.py:218
↓ 2 callers
Function
ci_width_and_coverage
Fits two types of uncertainty model depending on the input of conditional_cols
greykite/tests/algo/common/test_ml_models.py:898
↓ 2 callers
Method
create_df_with_regressor
Create dataframe with additional regressor columns of the level shift detected. Parameters ---------- df : `pandas.DataFrame`
greykite/algo/changepoint/shift_detection/shift_detector.py:311
↓ 2 callers
Method
create_regressor_for_future_dates
Expand dataframe to future dates based on the forecast_horizon. Parameters ---------- df : `pandas.DataFrame` The
greykite/algo/changepoint/shift_detection/shift_detector.py:352
↓ 2 callers
Function
cross_validate_all_models
Runs cross validation for all algo, data pairs. It returns a dictionary which contains the error for each model / data pair. The inpu
greykite/tests/algo/forecast/silverkite/test_forecast_silverkite.py:2548
↓ 2 callers
Function
elementwise_absolute_error
The absolute error between a single true and predicted value. Parameters ---------- true_val : float True value. pred_val : f
greykite/common/evaluation.py:718
↓ 2 callers
Function
elementwise_quantile
The quantile loss between a single true and predicted value. Parameters ---------- true_val : float True value. pred_val : fl
greykite/common/evaluation.py:802
↓ 2 callers
Function
elementwise_residual
The residual between a single true and predicted value. Parameters ---------- true_val : float True value. pred_val : float
greykite/common/evaluation.py:700
↓ 2 callers
Function
elementwise_squared_error
The absolute error between a single true and predicted value. Parameters ---------- true_val : float True value. pred_val : f
greykite/common/evaluation.py:736
← previous
next →
401–500 of 2,034, ranked by callers