prophet_regressor ============================================================================= .. py:module:: evalml.pipelines.components.estimators.regressors.prophet_regressor .. autoapi-nested-parse:: Prophet is a procedure for forecasting time series data based on an additive model where non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. It works best with time series that have strong seasonal effects and several seasons of historical data. Prophet is robust to missing data and shifts in the trend, and typically handles outliers well. Module Contents --------------- Classes Summary ~~~~~~~~~~~~~~~ .. autoapisummary:: evalml.pipelines.components.estimators.regressors.prophet_regressor.ProphetRegressor Contents ~~~~~~~~~~~~~~~~~~~ .. py:class:: ProphetRegressor(time_index: Optional[Hashable] = None, changepoint_prior_scale: float = 0.05, seasonality_prior_scale: int = 10, holidays_prior_scale: int = 10, seasonality_mode: str = 'additive', stan_backend: str = 'CMDSTANPY', interval_width: float = 0.95, random_seed: Union[int, float] = 0, **kwargs) Prophet is a procedure for forecasting time series data based on an additive model where non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. It works best with time series that have strong seasonal effects and several seasons of historical data. Prophet is robust to missing data and shifts in the trend, and typically handles outliers well. More information here: https://facebook.github.io/prophet/ :param time_index: Specifies the name of the column in X that provides the datetime objects. Defaults to None. :type time_index: str :param changepoint_prior_scale: Determines the strength of the sparse prior for fitting on rate changes. Increasing this value increases the flexibility of the trend. Defaults to 0.05. :type changepoint_prior_scale: float :param seasonality_prior_scale: Similar to changepoint_prior_scale. Adjusts the extent to which the seasonality model will fit the data. Defaults to 10. :type seasonality_prior_scale: int :param holidays_prior_scale: Similar to changepoint_prior_scale. Adjusts the extent to which holidays will fit the data. Defaults to 10. :type holidays_prior_scale: int :param seasonality_mode: Determines how this component fits the seasonality. Options are "additive" and "multiplicative". Defaults to "additive". :type seasonality_mode: str :param stan_backend: Determines the backend that should be used to run Prophet. Options are "CMDSTANPY" and "PYSTAN". Defaults to "CMDSTANPY". :type stan_backend: str :param interval_width: Determines the confidence of the prediction interval range when calling `get_prediction_intervals`. Accepts values in the range (0,1). Defaults to 0.95. :type interval_width: float :param random_seed: Seed for the random number generator. Defaults to 0. :type random_seed: int **Attributes** .. list-table:: :widths: 15 85 :header-rows: 0 * - **hyperparameter_ranges** - { "changepoint_prior_scale": Real(0.001, 0.5), "seasonality_prior_scale": Real(0.01, 10), "holidays_prior_scale": Real(0.01, 10), "seasonality_mode": ["additive", "multiplicative"],} * - **model_family** - ModelFamily.PROPHET * - **modifies_features** - True * - **modifies_target** - False * - **name** - Prophet Regressor * - **supported_problem_types** - [ProblemTypes.TIME_SERIES_REGRESSION] * - **training_only** - False **Methods** .. autoapisummary:: :nosignatures: evalml.pipelines.components.estimators.regressors.prophet_regressor.ProphetRegressor.build_prophet_df evalml.pipelines.components.estimators.regressors.prophet_regressor.ProphetRegressor.clone evalml.pipelines.components.estimators.regressors.prophet_regressor.ProphetRegressor.default_parameters evalml.pipelines.components.estimators.regressors.prophet_regressor.ProphetRegressor.describe evalml.pipelines.components.estimators.regressors.prophet_regressor.ProphetRegressor.feature_importance evalml.pipelines.components.estimators.regressors.prophet_regressor.ProphetRegressor.fit evalml.pipelines.components.estimators.regressors.prophet_regressor.ProphetRegressor.get_params evalml.pipelines.components.estimators.regressors.prophet_regressor.ProphetRegressor.get_prediction_intervals evalml.pipelines.components.estimators.regressors.prophet_regressor.ProphetRegressor.load evalml.pipelines.components.estimators.regressors.prophet_regressor.ProphetRegressor.needs_fitting evalml.pipelines.components.estimators.regressors.prophet_regressor.ProphetRegressor.parameters evalml.pipelines.components.estimators.regressors.prophet_regressor.ProphetRegressor.predict evalml.pipelines.components.estimators.regressors.prophet_regressor.ProphetRegressor.predict_proba evalml.pipelines.components.estimators.regressors.prophet_regressor.ProphetRegressor.save evalml.pipelines.components.estimators.regressors.prophet_regressor.ProphetRegressor.update_parameters .. py:method:: build_prophet_df(X: pandas.DataFrame, y: Optional[pandas.Series] = None, time_index: str = 'ds') -> pandas.DataFrame :staticmethod: Build the Prophet data to pass fit and predict on. .. py:method:: clone(self) Constructs a new component with the same parameters and random state. :returns: A new instance of this component with identical parameters and random state. .. py:method:: default_parameters(cls) -> dict Returns the default parameters for this component. :returns: Default parameters for this component. :rtype: dict .. py:method:: describe(self, print_name=False, return_dict=False) Describe a component and its parameters. :param print_name: whether to print name of component :type print_name: bool, optional :param return_dict: whether to return description as dictionary in the format {"name": name, "parameters": parameters} :type return_dict: bool, optional :returns: Returns dictionary if return_dict is True, else None. :rtype: None or dict .. py:method:: feature_importance(self) -> numpy.ndarray :property: Returns array of 0's with len(1) as feature_importance is not defined for Prophet regressor. .. py:method:: fit(self, X: pandas.DataFrame, y: Optional[pandas.Series] = None) Fits Prophet regressor component to data. :param X: The input training data of shape [n_samples, n_features]. :type X: pd.DataFrame :param y: The target training data of length [n_samples]. :type y: pd.Series :returns: self .. py:method:: get_params(self) -> dict Get parameters for the Prophet regressor. .. py:method:: get_prediction_intervals(self, X: pandas.DataFrame, y: Optional[pandas.Series] = None, coverage: List[float] = None, predictions: pandas.Series = None) -> Dict[str, pandas.Series] Find the prediction intervals using the fitted ProphetRegressor. :param X: Data of shape [n_samples, n_features]. :type X: pd.DataFrame :param y: Target data. Ignored. :type y: pd.Series :param coverage: A list of floats between the values 0 and 1 that the upper and lower bounds of the prediction interval should be calculated for. :type coverage: List[float] :param predictions: Not used for Prophet estimator. :type predictions: pd.Series :returns: Prediction intervals, keys are in the format {coverage}_lower or {coverage}_upper. :rtype: dict .. py:method:: load(file_path) :staticmethod: Loads component at file path. :param file_path: Location to load file. :type file_path: str :returns: ComponentBase object .. py:method:: needs_fitting(self) Returns boolean determining if component needs fitting before calling predict, predict_proba, transform, or feature_importances. This can be overridden to False for components that do not need to be fit or whose fit methods do nothing. :returns: True. .. py:method:: parameters(self) :property: Returns the parameters which were used to initialize the component. .. py:method:: predict(self, X: pandas.DataFrame, y: Optional[pandas.Series] = None) -> pandas.Series Make predictions using fitted Prophet regressor. :param X: Data of shape [n_samples, n_features]. :type X: pd.DataFrame :param y: Target data. Ignored. :type y: pd.Series :returns: Predicted values. :rtype: pd.Series .. py:method:: predict_proba(self, X: pandas.DataFrame) -> pandas.Series Make probability estimates for labels. :param X: Features. :type X: pd.DataFrame :returns: Probability estimates. :rtype: pd.Series :raises MethodPropertyNotFoundError: If estimator does not have a predict_proba method or a component_obj that implements predict_proba. .. py:method:: save(self, file_path, pickle_protocol=cloudpickle.DEFAULT_PROTOCOL) Saves component at file path. :param file_path: Location to save file. :type file_path: str :param pickle_protocol: The pickle data stream format. :type pickle_protocol: int .. py:method:: update_parameters(self, update_dict, reset_fit=True) Updates the parameter dictionary of the component. :param update_dict: A dict of parameters to update. :type update_dict: dict :param reset_fit: If True, will set `_is_fitted` to False. :type reset_fit: bool, optional