MCPcopy Index your code

hub / github.com/linkedin/greykite / functions

Functions2,034 in github.com/linkedin/greykite

↓ 8 callersMethodpredict_uncertainty
Makes predictions of prediction intervals for ``df`` based on the predictions and ``self.uncertainty_model``. Parameters ----
greykite/sklearn/estimator/base_forecast_estimator.py:323
↓ 8 callersFunctionrecall_score
Computes the recall scores for two arrays. Parameters ---------- y_true : array-like, 1-D The actual categories. y_pred : arr
greykite/detection/common/ad_evaluation.py:125
↓ 7 callersMethod_adjust_trend
Adjusts the time series by removing trend. There methods to remove trend from time series are listed in `~greykite.algo.common.season
greykite/algo/common/seasonality_inferrer.py:488
↓ 7 callersMethod_transform_country_holidays
Decouples a list of {country}_{holiday} names into a list of (country, holiday) tuple or the other way around, depending on the input type.
greykite/algo/common/holiday_inferrer.py:440
↓ 7 callersFunctionassert_equal_ad_config
Asserts equality between two instances of `ADConfig`. Raises a ValueError in case of a parameter mismatch. Parameters ---------- ad_c
greykite/detection/detector/config.py:174
↓ 7 callersFunctionassert_refit
Checks if `refit` is initialized with metric = expected_metric, and greater_is_better = expected_greater_is_better. Parameters
greykite/framework/utils/framework_testing_utils.py:28
↓ 7 callersFunctionbuild_autoreg_df
This function generates a function ("build_lags_func" in the returned dict) which when called builds a lag data frame and an aggregated lag da
greykite/common/features/timeseries_lags.py:323
↓ 7 callersFunctionbuild_lag_df
A function which builds a dataframe including time series lags (in the form of data frame columns) for a given value column (value_col) from a
greykite/common/features/timeseries_lags.py:29
↓ 7 callersFunctiondaily_data_reg
()
greykite/common/testing_utils.py:319
↓ 7 callersMethoddetect
This method uses the fitted parameters to decide if a point should be labeled as outlier and also provides a score. This meth
greykite/common/features/outlier.py:463
↓ 7 callersFunctiondictionaries_values_to_lists
Calls `~greykite.common.utils.python_utils.dictionary_values_to_lists` on the provided dictionary or on each item in a list of dictionaries.
greykite/common/python_utils.py:535
↓ 7 callersFunctionelementwise_outside_tolerance
Whether the relative difference between ``pred_val`` and ``true_val`` is strictly greater than ``rtol``. Parameters ---------- true_v
greykite/common/evaluation.py:822
↓ 7 callersFunctionfill_missing_dates
Looks for gaps in df[time_col] and returns a pandas.DataFrame with the missing rows added in. Warning: if freq doesn't match intended
greykite/common/time_properties.py:153
↓ 7 callersMethodfit_uncertainty
Fits the uncertainty model with a given ``df`` and ``uncertainty_dict``. Parameters ---------- df : `pandas.DataFrame`
greykite/sklearn/estimator/base_forecast_estimator.py:241
↓ 7 callersFunctionforecast_config_from_dict
(s: Any)
greykite/framework/templates/autogen/forecast_config.py:482
↓ 7 callersFunctionget_anomaly_df
Computes anomaly dataframe from a labeled ``df``. Parameters ---------- df : `pandas.DataFrame` A data frame which includes minim
greykite/detection/detector/ad_utils.py:179
↓ 7 callersFunctionget_basic_pipeline
Returns a basic pipeline for univariate forecasting. Allows for outlier detection, normalization, null imputation, degenerate column removal,
greykite/framework/pipeline/utils.py:220
↓ 7 callersFunctionget_canonical_anomaly_df
Validates and merges overlapping anomaly periods in anomaly dataframe. Also standardizes column names. For example, consider the following in
greykite/detection/detector/ad_utils.py:247
↓ 7 callersFunctionget_changepoint_features
Returns features for growth terms with continuous time origins at the changepoint_values (locations) specified Generates a time series fe
greykite/common/features/timeseries_features.py:1043
↓ 7 callersFunctionget_changepoint_values_from_config
Applies the changepoint method specified in `changepoints_dict` to return the changepoint values :param changepoints_dict: Optional[Dict[str, any
greykite/common/features/timeseries_features.py:1121
↓ 7 callersFunctionget_default_time_parameters
Returns default forecast horizon, backtest, and cross-validation parameters, given the input frequency, size, and user requested values. This
greykite/framework/pipeline/utils.py:112
↓ 7 callersFunctionget_dow_grouped_suffix
Utility function to generate a suffix given an input ``date``. Parameters ---------- date : `datetime.datetime` Input timestamp.
greykite/algo/common/holiday_utils.py:74
↓ 7 callersFunctionget_evenly_spaced_changepoints_dates
Partitions interval into n_changepoints + 1 segments, placing a changepoint at left endpoint of each segment. The left most segment do
greykite/common/features/timeseries_features.py:959
↓ 7 callersFunctionget_event_pred_cols
Generates the names of internal predictor columns from the event dictionary passed to `~greykite.algo.forecast.silverkite.forecast_silverkite.
greykite/algo/forecast/silverkite/forecast_simple_silverkite_helper.py:268
↓ 7 callersFunctionget_fit_params
Returns parameters for `greykite.algo.reconcile.convex.reconcile_forecasts.ReconcileAdditiveForecasts.fit` corresponding to recognized hierarc
greykite/algo/reconcile/convex/reconcile_forecasts.py:113
↓ 7 callersMethodget_hyperparameter_grid
Gets the hyperparameter grid for the Multistage Forecast Model. Returns ------- hyperparameter_grid : `dict` [`str`, `list` [
greykite/framework/templates/multistage_forecast_template.py:170
↓ 7 callersFunctionget_weekday_weekend_suffix
Utility function to generate a suffix given an input ``date``. Parameters ---------- date : `datetime.datetime` Input timestamp.
greykite/algo/common/holiday_utils.py:97
↓ 7 callersFunctionmutable_field
Can be used to set the default value in a dataclass to a mutable value. Provides a factory function that returns a copy of the provided argum
greykite/common/python_utils.py:738
↓ 7 callersMethodplot
Plots predicted against actual. Parameters ---------- kwargs : additional parameters Additional parameters to pas
greykite/framework/output/univariate_forecast.py:243
↓ 7 callersMethodpredict
Creates forecast for dates specified in ``X``. Parameters ---------- X : `pandas.DataFrame` Input timeseries with
greykite/sklearn/estimator/prophet_estimator.py:255
↓ 7 callersMethodpredict
Creates forecast for the dates specified in ``X``. Currently does not support the regressor case where there is gap between train and
greykite/sklearn/estimator/auto_arima_estimator.py:260
↓ 7 callersMethodpredict_via_sim_fast
Performs predictions and calculates uncertainty using one simulation of future and calculate the error separately (not relying on mult
greykite/algo/forecast/silverkite/forecast_silverkite.py:1793
↓ 7 callersFunctionprocess_intercept
Processes the intercept term. Merges intercept in beta and dummy column in x if they are not there. Appends "(Intercept)" to the front of ``p
greykite/algo/common/model_summary_utils.py:41
↓ 7 callersFunctionroot_mean_squared_error
Calculates root mean square error. :param y_true: observed values given in a list (or numpy array) :param y_pred: predicted values given in a
greykite/common/evaluation.py:464
↓ 7 callersFunctionsigned_pow
Takes the absolute value of x and raises it to power of y. Then it multiplies the result by sign of x. This guarantees this function is non-d
greykite/common/features/timeseries_features.py:1556
↓ 7 callersFunctionsplit_offset_str
Splits a pandas offset string into number part and frequency string part. Parameters ---------- offset_str : `str` An offset stri
greykite/common/python_utils.py:837
↓ 7 callersMethodtransform
Transforms the provided forecasts using the fitted ``self.transform_matrix``. Parameters ---------- forecasts_test :
greykite/algo/reconcile/convex/reconcile_forecasts.py:1155
↓ 6 callersMethod_form_constraints
Forms the constraints for convex optimization. The following attributes should be set before calling this method: - constraint_ma
greykite/algo/reconcile/convex/reconcile_forecasts.py:724
↓ 6 callersMethod_get_event_df_for_single_event
Gets the event df for a single holiday. An event df has the format: pd.DataFrame({ "date": ["2020-09-01", "2021-09-01"],
greykite/algo/common/holiday_inferrer.py:769
↓ 6 callersFunctionadd_new_params_to_records
For a list of records (each being a `dict`) and a set of parameters each having a list of potential values, it expands each record in all possible
greykite/detection/detector/ad_utils.py:129
↓ 6 callersFunctionall_equal_length
Checks whether input arrays have equal length. :param arrays: one or more lists/numpy arrays/pd.Series :return: true if lengths are all equal
greykite/common/evaluation.py:57
↓ 6 callersFunctionapply_default_model_components
Sets default values for ``model_components``. Parameters ---------- model_components : :class:`~greykite.framework.templates.autogen.fore
greykite/framework/templates/silverkite_template.py:81
↓ 6 callersMethodapply_model_components_defaults
Applies the default ModelComponentsParam values to the given object. Converts None to a ModelComponentsParam object. Unpacks a list o
greykite/framework/templates/forecast_config_defaults.py:170
↓ 6 callersMethodapply_model_template_defaults
Applies the default model template to the given object. Unpacks a list of a single element to the element itself. Sets default value
greykite/framework/templates/forecast_config_defaults.py:200
↓ 6 callersMethodapply_template_for_pipeline_params
(self, df: pandas.DataFrame, config: ForecastConfig)
greykite/tests/framework/templates/test_template_interface.py:21
↓ 6 callersFunctionassert_equal_forecast_config
Asserts equality between two instances of `ForecastConfig`. Raises an error in case of parameter mismatch. Parameters ---------- fore
greykite/framework/templates/autogen/forecast_config.py:490
↓ 6 callersFunctionassert_scoring
Checks if `scoring` has the expected keys and score functions defined by the other parameters. Parameters ---------- scoring : `dict`
greykite/framework/utils/framework_testing_utils.py:49
↓ 6 callersFunctionbreakdown_regression_based_prediction
Given a regression based ML model (``ml_model``) and a design matrix (``x_mat``), and a string based grouping rule (``grouping_regex_patterns_dict
greykite/algo/common/ml_models.py:1080
↓ 6 callersFunctionbuild_trend_feature_df_with_changes
A function to generate trend features from a given time series df. The trend features include columns of the format max(0, x-c_i), where c_i is t
greykite/algo/changepoint/adalasso/changepoints_utils.py:84
↓ 6 callersFunctioncombine_detected_and_custom_trend_changepoints
Adds custom trend changepoints to detected trend changepoints. Compares the distance between custom changepoints and detected changepoints, a
greykite/algo/changepoint/adalasso/changepoints_utils.py:1364
↓ 6 callersFunctioncompute_fitted_components
Computes the fitted values with selected regressors indicated by ``regex`` Parameters ---------- x : `pandas.DataFrame` The desig
greykite/algo/changepoint/adalasso/changepoints_utils.py:317
↓ 6 callersFunctioncompute_min_changepoint_index_distance
Computes the minimal index distance between two consecutive detected change points. Given a df, its time column, the number of change points that
greykite/algo/changepoint/adalasso/changepoints_utils.py:773
↓ 6 callersFunctioncontaminate_df_with_anomalies
Contaminate a dataframe with anomalies. If original value is y, the anomalous value is (1 +/- delta)y, the + or - chosen randomly. :param df:
greykite/common/testing_utils_anomalies.py:69
↓ 6 callersFunctioncorrelation
Calculates correlation. :param y_true: observed values given in a list (or numpy array) :param y_pred: predicted values given in a list (or n
greykite/common/evaluation.py:475
↓ 6 callersFunctiondesign_mat_from_formula
Given a formula it extracts the response vector (y) and builds the design matrix (x_mat). Parameters ---------- df : `pandas.DataFra
greykite/algo/common/ml_models.py:121
↓ 6 callersFunctiondictionary_values_to_lists
Given a dictionary, returns a copy whose values are either lists, distributions with a ``rvs`` method, or None. The output is suitable for h
greykite/common/python_utils.py:417
↓ 6 callersFunctionfind_neighbor_changepoints
Finds neighbor change points given their indices For example x = [1, 2, 3, 7, 8, 10, 15, 20] The return with `min_index_distance`=2 i
greykite/algo/changepoint/adalasso/changepoints_utils.py:673
↓ 6 callersFunctionfit_forecast_with_regressor
( regressor_cols=[], lagged_regressor_cols=[], lagged_regressor_dict=None,
greykite/tests/algo/forecast/silverkite/test_forecast_silverkite.py:1269
↓ 6 callersMethodfit_transform
Fits and transforms training data. Parameters ---------- forecasts : `pandas.DataFrame` Forecasts to fit the adju
greykite/algo/reconcile/convex/reconcile_forecasts.py:1387
↓ 6 callersFunctionflatten_list
Flattens an array by removing 1 level of nesting. Parameters ---------- array : `list` [`list`] List of lists. Returns -
greykite/common/python_utils.py:627
↓ 6 callersMethodfrom_json
Converts a json string to the corresponding instance of the `ADConfig` class. Raises ValueError if the input is not a json string.
greykite/detection/detector/config.py:157
↓ 6 callersFunctionfrom_list_dict
Parses list of dictionaries, applying `f` to the dictionary values. All items must be dictionaries.
greykite/framework/templates/autogen/forecast_config.py:52
↓ 6 callersFunctionfrom_list_dict_or_none
Parses list of dictionaries or None elements, applying `f` to the dictionary values. If an element in the list is None, it is returned directly.
greykite/framework/templates/autogen/forecast_config.py:61
↓ 6 callersFunctiongen_moving_timeseries_forecast
Applies a forecast function (`train_forecast_func`) to many derived timeseries from `df` which are moving windows of `df`. For each derived se
greykite/common/gen_moving_timeseries_forecast.py:30
↓ 6 callersFunctionget_actual_changepoint_min_distance
Gets the minimum distance between detected changepoints. Parameters ---------- min_increment : `datetime.timedelta` The minimum i
greykite/algo/changepoint/adalasso/auto_changepoint_params.py:242
↓ 6 callersFunctionget_changepoint_features_and_values_from_config
Extracts changepoints from changepoint configuration and input data :param df: pd.DataFrame Training data. A data frame which includes th
greykite/common/features/timeseries_features.py:1194
↓ 6 callersFunctionget_changepoint_resample_freq
Gets the changepoint detection resample frequency parameter. Parameters ---------- n_points : `int` The number of data points in
greykite/algo/changepoint/adalasso/auto_changepoint_params.py:38
↓ 6 callersFunctionget_changepoint_string
Gets proper formatted strings for changepoint dates. The default format is "_%Y_%m_%d_%H". When necessary, it appends "_%M" or "_%M_%S". Par
greykite/common/features/timeseries_features.py:1018
↓ 6 callersMethodget_evaluation_metrics
Returns rolling train and test evaluation metric values. Parameters ---------- metric_dict : `dict` [`str`, `callable`]
greykite/framework/benchmark/benchmark_class.py:361
↓ 6 callersMethodget_flexible_grouping_evaluation
Group-wise computation of evaluation metrics. Whereas ``self.get_grouping_evaluation`` computes one metric, this allows computation of any num
greykite/framework/output/univariate_forecast.py:490
↓ 6 callersFunctionget_forecast
Runs model predictions on ``df`` and creates a `~greykite.framework.output.univariate_forecast.UnivariateForecast` object. Parameters ---
greykite/framework/pipeline/utils.py:726
↓ 6 callersMethodget_grouping_evaluation_metrics
Returns splitwise rolling evaluation metric values. These values are grouped by the grouping method chosen by ``groupby_time_feature``,
greykite/framework/benchmark/benchmark_class.py:563
↓ 6 callersFunctionget_hyperparameter_searcher
Returns RandomizedSearchCV object for hyperparameter tuning via cross validation `sklearn.model_selection.RandomizedSearchCV` runs a full grid se
greykite/framework/pipeline/utils.py:629
↓ 6 callersFunctionget_ranks_and_splits
Extracts CV results from ``grid_search`` for the specified score function. Returns the correct ranks on the test set and a tuple of the scores acr
greykite/framework/utils/result_summary.py:40
↓ 6 callersMethodget_regressor_cols
Returns regressor column names from the model components. Implements the method in `~greykite.framework.templates.base_template.BaseTemplate`
greykite/framework/templates/simple_silverkite_template.py:631
↓ 6 callersMethodget_regressor_cols
Returns regressor column names. Implements the method in `~greykite.framework.templates.base_template.BaseTemplate`. Returns
greykite/framework/templates/prophet_template.py:296
↓ 6 callersFunctionget_scoring_and_refit
Provides ``scoring`` and ``refit`` parameters for `~sklearn.model_selection.RandomizedSearchCV`. Together, ``scoring`` and ``refit`` specify
greykite/framework/pipeline/utils.py:477
↓ 6 callersFunctionget_yearly_seasonality_changepoint_dates_from_freq
Gets the yearly seasonality changepoint dates from change frequency. This is an internal function used for varying yearly seasonality effects in
greykite/algo/changepoint/adalasso/changepoints_utils.py:1305
↓ 6 callersMethodinfer_fourier_series_order
Infers the most appropriate Fourier series order. Can infer multiple seasonality components with multiple configs at the same time. Th
greykite/algo/common/seasonality_inferrer.py:176
↓ 6 callersFunctioninformedness_statistic
Computes the Informedness also known as the Youden's J statistic for two arrays. Youden's J statistic is defined as J = sensitivity + specificity
greykite/detection/common/ad_evaluation.py:242
↓ 6 callersFunctionlabel_anomalies_multi_metric
This function operates on a given data frame (``df``) which includes time (given in ``time_col``) and metrics. For each metric (given in ``val
greykite/common/features/adjust_anomalous_data.py:270
↓ 6 callersFunctionmean_absolute_percent_error
Calculates mean absolute percentage error. :param y_true: observed values given in a list (or numpy array) :param y_pred: predicted values gi
greykite/common/evaluation.py:409
↓ 6 callersFunctionmedian_absolute_percent_error
Calculates median absolute percentage error. :param y_true: observed values given in a list (or numpy array) :param y_pred: predicted values
greykite/common/evaluation.py:426
↓ 6 callersFunctionoptimize_df_with_constraints
Function that solves the following constrained optimization problem. maximize ``df``[``objective_col``] subject to ``df``[``constrain
greykite/detection/detector/ad_utils.py:331
↓ 6 callersMethodoptimize_param
The optimizer which picks the best possible parameter from the ones specified in ``param_iterable``, using the reward specified in the
greykite/detection/detector/optimizer.py:131
↓ 6 callersMethodplot_transform_matrix
Plots the transform matrix visually, as a grid. By default, negative values are red and positive values are blue. Parameters
greykite/algo/reconcile/convex/reconcile_forecasts.py:1457
↓ 6 callersFunctionpredict_ml_with_uncertainty
Returns predictions and prediction intervals on new data using the machine-learning (ml) model fitted via ``fit_ml_model`` and the uncertainty
greykite/algo/common/ml_models.py:758
↓ 6 callersFunctionquantile_loss
Calculates the quantile (pinball) loss with quantile q of y_true and y_pred. :param y_true: one column of true values. :type y_true: list or
greykite/common/evaluation.py:493
↓ 6 callersFunctionsimplify_name
Simplifies the predictor names to make them shorter. Parameters ---------- name : `str` The predictor name. Should be a simple t
greykite/algo/common/col_name_utils.py:114
↓ 6 callersFunctionto_class
(c: Type[T], x: Any)
greykite/framework/templates/autogen/forecast_config.py:102
↓ 6 callersFunctionvalidate_dst_times
Assuming dayligh saving starts on ``dst_start`` and ends on ``dst_end``, it performs a series of assertion to ensure the function ``is_dst_fun
greykite/tests/common/features/test_timeseries_features.py:62
↓ 5 callersMethod_apply_default_value
For the corresponding parameter in each config in ``configs``, replaces `None` with default values; overrides all values if ``override
greykite/algo/common/seasonality_inferrer.py:430
↓ 5 callersMethod_check_input
Checks that necessary input are provided in ``self.uncertainty_dict`` and ``self.train_df``. This check only raises `~greykite.sklearn
greykite/sklearn/uncertainty/quantile_regression_uncertainty_model.py:156
↓ 5 callersMethod_form_objective
Forms the objective for convex optimization. The objective is a sum of four types of errors:: obj = adj + bias + train + var
greykite/algo/reconcile/convex/reconcile_forecasts.py:796
↓ 5 callersMethod_get_keys_from_serialized_dict
Returns the keys from a `serialized_dict`, the output of `dumps`. Parameters ---------- serialized_dict: `dict` T
greykite/detection/common/pickler.py:625
↓ 5 callersFunctionadd_multi_vrects
Adds vertical rectangle shadings to existing figure. Each vertical rectangle information is given in rows of data frame ``periods_df``. The in
greykite/common/viz/timeseries_annotate.py:790
↓ 5 callersFunctionassert_proper_grid_search
Checks fitted hyperparameter grid search result. Parameters ---------- grid_search : `sklearn.model_selection.RandomizedSearchCV`
greykite/framework/utils/framework_testing_utils.py:94
↓ 5 callersFunctionbuild_autoreg_df_multi
A function which returns a function to build autoregression dataframe for multiple value columns. This function should not be applied to data
greykite/common/features/timeseries_lags.py:528
↓ 5 callersFunctionbuild_lags_func
A function which uses: df (pd.Dataframe), past_df (pd.DataFrame) and returns lag_df and agg_lag_df for df. This fu
greykite/common/features/timeseries_lags.py:429
↓ 5 callersFunctionbuild_seasonality_feature_df_from_detection_result
Builds seasonality feature df from detected seasonality change points. The function is an extension of ``build_seasonality_feature_df_with_change
greykite/algo/changepoint/adalasso/changepoints_utils.py:248
← previousnext →201–300 of 2,034, ranked by callers