MCPcopy Index your code

hub / github.com/linkedin/greykite / functions

Functions2,034 in github.com/linkedin/greykite

↓ 13 callersFunctionr2_null_model_score
Calculates improvement in the loss function compared to the predictions of a null model. Can be used to evaluate model quality with respect to
greykite/common/evaluation.py:255
↓ 12 callersFunctionadd_finite_filter_to_scorer
Takes a scorer and returns a scorer that ignores NA / infinite elements in y_true. sklearn scorers (and others) don't handle arrays with 0 length
greykite/common/evaluation.py:222
↓ 12 callersFunctionaggregate_array
Aggregates input array. Divides array from left to right into bins of size agg_periods, and applies agg_func to each block. Drops records from
greykite/common/evaluation.py:163
↓ 12 callersFunctioncheck_freq_unit_at_most_day
Checks if the ``freq`` parameter passed to a function has unit at most "D" Parameters ---------- freq : `DateOffset`, `Timedelta` or `str
greykite/algo/changepoint/adalasso/changepoints_utils.py:56
↓ 12 callersFunctioncols_interact
Returns all interactions between static_col and fourier series up to specified order :param static_col: column to interact with fourier s
greykite/algo/forecast/silverkite/forecast_simple_silverkite_helper.py:40
↓ 12 callersFunctioncompute_range_based_score
Given two lists of anomaly ranges, calculate a range-based score over the time series represented by the first list of anomaly ranges. If ``anomal
greykite/detection/common/ad_evaluation_utils.py:238
↓ 12 callersMethodfit
(self, X, y=None, time_col=TIME_COL, value_col=VALUE_COL, **fit_params)
greykite/tests/sklearn/estimator/test_base_forecast_estimator.py:71
↓ 12 callersFunctionfit_ml_model
Fits predictive ML (machine learning) models to continuous response vector (given in ``y_col``) and returns fitted model. Parameters
greykite/algo/common/ml_models.py:381
↓ 12 callersFunctionfraction_outside_tolerance
Returns the fraction of predicted values whose relative difference from the true value is strictly greater than ``rtol``. Parameters ----
greykite/common/evaluation.py:541
↓ 12 callersFunctiongeneric_test_adjust_anomalous_data
Generic test for the results of any given scenario
greykite/common/testing_utils.py:416
↓ 12 callersMethodget_aggregated_data
Returns aggregated data. Parameters ---------- df : `pandas.DataFrame`. The input data must have TIME_COL ("ts")
greykite/common/data_loader.py:99
↓ 12 callersFunctionget_auto_holidays
Automatically group holidays and their neighboring days based on estimated holiday impact. Parameters ---------- df : `pandas.DataFrame`
greykite/algo/forecast/silverkite/auto_config.py:261
↓ 12 callersFunctionget_forecast_time_properties
Returns the number of training points in `df`, the start year, and prediction end year Parameters ---------- df : `pandas.DataFrame` with
greykite/common/time_properties_forecast.py:78
↓ 12 callersMethodget_n_splits_without_capping
Returns the number of splitting iterations in the cross-validator as configured, ignoring self.max_splits and self.min_splits Par
greykite/sklearn/cross_validation.py:251
↓ 12 callersFunctionget_timestamp_floor
Returns the largest timestamp that is smaller than or equal to `ts` and is also a multiple of the `freq`. Assume hourly frequency i.e. `freq`
greykite/detection/detector/ad_utils.py:475
↓ 12 callersFunctioninfer_freq
Infers frequency of the timestamps provided in the ``time_col`` of ``df``. Notes ----- If the timeseries does not have any missing values
greykite/common/time_properties.py:497
↓ 12 callersFunctionlogistic
Evaluates the logistic function at x with the specified growth rate, capacity, floor, and inflection point. :param x: value to evaluate t
greykite/common/features/timeseries_features.py:1576
↓ 12 callersFunctionnormalize_df
For a given dataframe with columns including numerical values, it generates a function which can be applied to original data as well as any fu
greykite/common/features/normalize.py:27
↓ 12 callersFunctionprecision_score
Computes the precision scores for two arrays. Parameters ---------- y_true : array-like, 1-D The actual categories. y_pred :
greykite/detection/common/ad_evaluation.py:86
↓ 12 callersMethodpredict
Makes prediction for a given x. Parameters ---------- X : `numpy.array`, `pandas.DataFrame` or `pandas.Series` Th
greykite/algo/common/l1_quantile_regression.py:377
↓ 12 callersFunctionpredict_ci
Predicts the quantiles of the ``offset_col`` (defined in ``ci_model``) in ``new_df``. Parameters ---------- new_df : `pd.Dataframe`
greykite/algo/uncertainty/conditional/conf_interval.py:339
↓ 12 callersMethodto_dict
Converts an instance of the `ADConfig` class to its dictionary format.
greykite/detection/detector/config.py:114
↓ 12 callersFunctionunique_elements_in_list
Returns the unique elements in the input list, preserving the original order. Parameters ---------- array: `List` [`any`]
greykite/common/python_utils.py:122
↓ 11 callersMethodapply_forecast_config
Fetches pipeline parameters from the ``df`` and ``config``, but does not run the pipeline to generate a forecast. :py:meth:`~greykite
greykite/framework/templates/forecaster.py:303
↓ 11 callersFunctionassert_basic_pipeline_equal
Asserts that the two pipelines are equal The Pipelines should be created by `get_basic_pipeline`.
greykite/framework/utils/framework_testing_utils.py:317
↓ 11 callersFunctionassert_splits_equal
Asserts whether CV splits match expectation :param actual: np.array of np.arrays :param expected: np.array of np.arrays
greykite/tests/sklearn/test_cross_validation.py:7
↓ 11 callersFunctionconfig_to_reward
Uses information in `ADConfig` to construct a reward function. The constructed reward function will be the sum of various rewards related to t
greykite/detection/detector/config_to_reward.py:51
↓ 11 callersFunctionevaluation_plot
Helper function to create evaluation plots from traces. Creates a figure with subplots. Every dataframe in ``traces`` has the same columns.
greykite/algo/reconcile/convex/reconcile_forecasts.py:275
↓ 11 callersFunctionfilter_changepoints
Filters change points that are too close. Given the ``cp_block`` from the output of ``find_neighbor_changepoints`` and the corresponding coef
greykite/algo/changepoint/adalasso/changepoints_utils.py:819
↓ 11 callersFunctiongenerate_holiday_events
Returns holidays within the countries between ``year_start`` and ``year_end``. Creates a separate key, value for each item in ``holidays_to_model_
greykite/algo/forecast/silverkite/forecast_simple_silverkite_helper.py:147
↓ 11 callersFunctionget_anomaly_df_from_outliers
This function identifies extreme values as outliers based on z-scores. A normal distribution will be fit on ``value_col`` of input df, and the
greykite/detection/detector/ad_utils.py:505
↓ 11 callersMethodget_coef_summary
Gets the coefficient summary filtered by conditions. Parameters ---------- is_intercept : `bool` or `None`, default `None`
greykite/algo/common/model_summary.py:136
↓ 11 callersFunctionget_default_horizon_from_period
Returns default forecast horizon based on input data period and num_observations :param period: float Period of each observation (i.e. ave
greykite/common/time_properties_forecast.py:38
↓ 11 callersMethodget_hyperparameter_grid
Returns hyperparameter grid. Implements the method in `~greykite.framework.templates.base_template.BaseTemplate`. Converts model com
greykite/framework/templates/simple_silverkite_template.py:757
↓ 11 callersFunctionget_positional_reward
Positional reward for a single pointwise anomaly with an anomaly range Parameters ---------- loc : `int` Location of the pointwis
greykite/detection/common/ad_evaluation_utils.py:132
↓ 11 callersMethodload_data
Loads dataset by name from the internal data library. Parameters ---------- data_name : `str` Dataset to load fro
greykite/common/data_loader.py:686
↓ 11 callersFunctionpatsy_categorical_term
Returns categorical term for patsy. Optionally specify levels, coding, and quote the term :param term: str name of the categorical
greykite/algo/forecast/silverkite/forecast_simple_silverkite_helper.py:237
↓ 11 callersMethodpredict
``predict`` method is already implemented here and should work for most cases. This is because in most cases, ``predict`` is simply
greykite/detection/detector/detector.py:280
↓ 10 callersMethod_get_freq_col
Gets the column name for a specific stage/frequency. The name will be f"{self.time_col_}__{index}__{freq}". Parameters ------
greykite/sklearn/estimator/multistage_forecast_estimator.py:421
↓ 10 callersFunctionadd_preaggregation_to_scorer
Takes a scorer and returns a scorer that pre-aggregates input. :param score_func: function that maps two arrays to a number. E.g. (y_true, y_pred
greykite/common/evaluation.py:201
↓ 10 callersFunctionassert_eval_function_equal
Checks whether evaluation functions return the same output for a few inputs
greykite/common/testing_utils.py:486
↓ 10 callersFunctionbuild_agg_lag_df
A function which returns a dataframe including aggregated (e.g. averaged) time series lags in the form of dataframe columns. By "aggregated la
greykite/common/features/timeseries_lags.py:156
↓ 10 callersFunctionbuild_seasonality_feature_df_with_changes
A function to generate yearly seasonality features from a given time series df. The seasonality features include n_changepoints * 2 columns of th
greykite/algo/changepoint/adalasso/changepoints_utils.py:153
↓ 10 callersMethoddumps_to_str
Returns a serialized string representation of the `obj`. The `obj` must be serializable by `dill`. Serialized output `dill` is a byte
greykite/detection/common/pickler.py:589
↓ 10 callersMethodfit
Fits ``ARIMA`` forecast model. Parameters ---------- X : `pandas.DataFrame` Input timeseries, with timestamp colu
greykite/sklearn/estimator/auto_arima_estimator.py:177
↓ 10 callersMethodfit
( self, data=None)
greykite/detection/detector/detector.py:256
↓ 10 callersMethodfit
The fit method for Greykite based method. The fit consists of following stages: - Fit a forecast model using the ``forecast_confi
greykite/detection/detector/greykite.py:191
↓ 10 callersMethodfit
Fits the partial regularized regression. Parameters ---------- x : `numpy.array` or `pandas.DataFrame` The design
greykite/algo/common/partial_regularize_regression.py:359
↓ 10 callersFunctionfourier_series_multi_fcn
Generates a func which adds multiple fourier series with multiple periods. Parameters ---------- col_names : `list` [`str`] the c
greykite/common/features/timeseries_features.py:1497
↓ 10 callersMethodfrom_dict
Converts a dictionary to the corresponding instance of the `ADConfig` class. Raises ValueError if the input is not a dictionary.
greykite/detection/detector/config.py:80
↓ 10 callersMethodget_prophet_holidays
Generates holidays for Prophet model. Parameters ---------- year_list : `list` [`int`] List of years for selectin
greykite/framework/templates/prophet_template.py:236
↓ 10 callersFunctionget_weight_matrix
Returns a diagonal weight matrix with shape (``n_forecasts``, ``n_forecasts``) and Frobenius norm sqrt(`n_forecasts`). Parameters -------
greykite/algo/reconcile/convex/reconcile_forecasts.py:56
↓ 10 callersFunctionhelper_plot_outliers
This is just a helper function to generate plots for outlier detection during tests. This plots the raw input and marks the discovered anomalies.
greykite/tests/common/features/test_outlier.py:58
↓ 10 callersMethodplot
Makes a plot to show the observations/estimations/change points. In this function, component parameters specify if each component in the plot
greykite/algo/changepoint/adalasso/changepoint_detector.py:898
↓ 10 callersFunctionplot_anomalies_over_forecast_vs_actual
Utility function which overlayes the predicted anomalies or anomalies on the forecast vs actual plot. The function calls the internal function `~g
greykite/common/viz/timeseries_annotate.py:1198
↓ 10 callersFunctionplt_compare_series_annotations
A function which plots ``actual_col`` and ``forecast_col`` and well as ``forecast_lower_col``, ``forecast_upper_col`` with respect to x axis
greykite/common/viz/timeseries_annotate.py:174
↓ 10 callersFunctionprepare_anomaly_ranges
Convert a list of pointwise anomalies into a list of anomaly ranges Parameters ---------- pointwise_anmalies : array-like, 1-D Li
greykite/detection/common/ad_evaluation_utils.py:56
↓ 10 callersFunctionreorder_columns
Orders columns according to ``order_dict``. Can be used to order columns according to hierarchical constraints. Consider the tree where a par
greykite/common/python_utils.py:644
↓ 10 callersFunctionsplit_range_into_groups
Partitions `n` elements into adjacent groups, each with `group_size` elements Group number starts from 0 and increments upward
greykite/common/viz/timeseries_plotting.py:665
↓ 10 callersFunctionunique_in_list
Returns unique elements in ``array``, removing all levels of nesting if found. Parameters ---------- array : `list` [`any`] or None
greykite/common/python_utils.py:597
↓ 10 callersMethodvalidate
Validates the inputs to the class for the method ``run``. Raises a ValueError if there is a mismatch between the following parameters
greykite/framework/benchmark/benchmark_class.py:110
↓ 9 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/simple_conditional_residuals_model.py:107
↓ 9 callersMethod_initialize
Sets the derived attributes from model init parameters.
greykite/sklearn/estimator/multistage_forecast_estimator.py:340
↓ 9 callersFunctiondescribe_timeseries
Checks if a time series consists of equal time increments and if it is in increasing order. :param df: data.frame which includes the time col
greykite/common/time_properties.py:41
↓ 9 callersMethodevaluate
Evaluates the adjustment quality. Computes the following metrics for each of the `m` timeseries: "Base MAPE" : MAPE of ba
greykite/algo/reconcile/convex/reconcile_forecasts.py:1200
↓ 9 callersMethodforecast_breakdown
Generates silverkite forecast breakdown for groupings given in ``grouping_regex_patterns_dict``. Note that this only works for additiv
greykite/sklearn/estimator/base_silverkite_estimator.py:427
↓ 9 callersMethodforecast_simple
A wrapper around ``SilverkiteForecast::forecast`` that simplifies some of the input parameters. Parameters ---------- args :
greykite/algo/forecast/silverkite/forecast_simple_silverkite.py:882
↓ 9 callersFunctionget_auto_silverkite_model_template
Gets the most appropriate model template that fits the input df's frequency, forecast horizon and number of cv splits. We define the cv to be
greykite/framework/templates/auto_model_template.py:46
↓ 9 callersFunctionget_changepoints_dict
The functions takes the ``changepoints_dict`` dictionary and returns the processed ``changepoints_dict``. If "method" == "auto", the change p
greykite/algo/changepoint/adalasso/changepoint_detector.py:1045
↓ 9 callersFunctionget_evenly_spaced_changepoints_values
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:931
↓ 9 callersFunctionget_no_changepoint_distance_from_end
Gets the distance from end of time series where no changepoints will be placed. Parameters ---------- min_increment : `datetime.timedelta
greykite/algo/changepoint/adalasso/auto_changepoint_params.py:176
↓ 9 callersMethodload_beijing_pm
Loads the Beijing Particulate Matter (PM2.5) dataset. https://archive.ics.uci.edu/ml/datasets/Beijing+PM2.5+Data This hourly data set
greykite/common/data_loader.py:539
↓ 9 callersFunctionmin_max_lag_order
Calculating min and max lag order needed given the prescribed lags in the model. :param lag_dict: dict dictionary with these fields:
greykite/common/features/timeseries_lags.py:95
↓ 9 callersFunctionnormalize_df_func
A function which applies to a potentially new data frame (``new_df``) with the same columns as ``df`` (different values or row number is allow
greykite/common/features/normalize.py:124
↓ 9 callersFunctionplot_change
Makes a plot of the observed data and estimated components, as well as detected changes The function currently allows five different components t
greykite/algo/changepoint/adalasso/changepoints_utils.py:355
↓ 9 callersFunctionplot_forecast_vs_actual
Plots forecast with prediction intervals, against actuals Adapted from plotly user guide: https://plot.ly/python/v3/continuous-error-bars/#bas
greykite/common/viz/timeseries_plotting.py:446
↓ 9 callersMethodpredict
Creates forecast for dates specified in X Parameters ---------- X : pd.DataFrame with column (self.time_col_), the dates for
greykite/sklearn/estimator/null_model.py:146
↓ 9 callersMethodpredict_via_sim
Performs predictions and calculate uncertainty using multiple simulations. Parameters ---------- fut_df : `pandas.Dat
greykite/algo/forecast/silverkite/forecast_silverkite.py:1680
↓ 9 callersMethodsimulate
A function to simulate future series. If the fitted model supports uncertainty e.g. via ``uncertainty_dict``, errors are incorporated
greykite/algo/forecast/silverkite/forecast_silverkite.py:1351
↓ 8 callersMethod_add_agg_freq_cols
Appends the resample time columns to ``df``. For example, the original df has hourly data with columns "ts" and "y". The original tim
greykite/sklearn/estimator/multistage_forecast_estimator.py:457
↓ 8 callersMethod_sample_splits
Samples up to ``max_splits`` items from list(range(`num_splits`)). If ``use_most_recent_splits`` is True, highest split indices up to ``max_s
greykite/sklearn/cross_validation.py:293
↓ 8 callersFunctionadd_daily_events
For each key of event_df_dict, it adds a new column to a data frame (df) with a date column (date_col). Each new column will represent the eve
greykite/common/features/timeseries_features.py:715
↓ 8 callersMethoddiff_from_baseline
Calculates a baseline for the input series `y` and then removes that baseline from `y`, thus creating a diff series. Parameters
greykite/common/features/outlier.py:315
↓ 8 callersMethodexpand_holiday_df_with_suffix
Expands an input holiday dataframe ``holiday_df`` to include the neighboring days specified in ``holiday_impact_dict`` or through ``holiday_im
greykite/algo/common/holiday_grouper.py:785
↓ 8 callersFunctionf1_score
Computes the F1 scores for two arrays. Parameters ---------- y_true : array-like, 1-D The actual categories. y_pred : array-l
greykite/detection/common/ad_evaluation.py:164
↓ 8 callersMethodfit
Fits a model to training data. Parameters ---------- X : `pandas.DataFrame` Input timeseries, with timestamp colu
greykite/sklearn/estimator/one_by_one_estimator.py:319
↓ 8 callersMethodfit
Fits the regressor using X[value_col] Parameters ---------- X : pd.DataFrame with columns time_col and value_col
greykite/sklearn/estimator/null_model.py:104
↓ 8 callersFunctiongenerate_trend_changepoint_detection_params
Automatically generates trend changepoint detection parameters based on the input data and forecast horizon. Parameters ---------- df
greykite/algo/changepoint/adalasso/auto_changepoint_params.py:279
↓ 8 callersFunctionget_custom_changepoints_values
Returns the values of continuous_time_col at the requested changepoint_dates. :param df: pd.DataFrame training dataset. contains
greykite/common/features/timeseries_features.py:984
↓ 8 callersMethodget_data_inventory
Returns the names of the available internal datasets. Returns ------- file_names : `list` [`str`] The names of th
greykite/common/data_loader.py:159
↓ 8 callersFunctionget_overlap_size_and_position_reward
Calculates overlap reward for both size and position of two anomaly ranges Parameters ---------- anomaly_range_1 : list [int] A l
greykite/detection/common/ad_evaluation_utils.py:180
↓ 8 callersFunctionget_similar_lag
For a given frequency, it returns a lag which is likely to be most correlated to the observation at current time. For daily data, this will r
greykite/algo/forecast/silverkite/forecast_silverkite_helper.py:39
↓ 8 callersMethodget_valid_config_names
Validate ``config_names`` against keys of ``configs``. Raises a ValueError in case of a mismatch. Parameters ----------
greykite/framework/benchmark/benchmark_class.py:828
↓ 8 callersMethodgroup_holidays
Estimates the impact of holidays and their neighboring days and groups events with similar effects to several groups using kernel density esti
greykite/algo/common/holiday_grouper.py:235
↓ 8 callersFunctionimpute_with_lags
A function to impute timeseries values (given in ``df``) and in ``value_col`` with chosen lagged values or an aggregated of those. For example
greykite/common/features/timeseries_impute.py:28
↓ 8 callersMethodload_peyton_manning_ts
Loads the Daily Peyton Manning dataset. This dataset contains log daily page views for the Wikipedia page for Peyton Manning. One of
greykite/framework/benchmark/data_loader_ts.py:39
↓ 8 callersMethodloads_from_str
Returns a deserialized object from a `serialized_string`, usually the output of `dumps_to_str`. Parameters ----------
greykite/detection/common/pickler.py:609
↓ 8 callersFunctionmean_interval_score
Calculates the mean interval score. If an observed value falls within the interval, the score is simply the width of the interval. If an obser
greykite/common/evaluation.py:606
↓ 8 callersMethodobjective_fn
Evaluates the objective function for a given transform matrix and dataset. Parameters ---------- transform_matrix
greykite/algo/reconcile/convex/reconcile_forecasts.py:920
↓ 8 callersMethodpredict
Predicts the interval. Parameters ---------- fut_df : `pandas.DataFrame` The dataframe used for prediction.
greykite/sklearn/uncertainty/quantile_regression_uncertainty_model.py:342
← previousnext →101–200 of 2,034, ranked by callers