Skip to content

[BUG] Prophet with growth="growth="logistic" and growth_cap set to the array does the fit but fails on predict. #2621

@k1m190r

Description

@k1m190r

Describe the bug
Prophet allows logistic grown capacity and/ or floor to be either scalar or array. While fixing #1079 noticed that when set to array fit does the job but predict fails, as it attempts to reuse the same cap and floor params. predict expects cap and floor to be same length as fh and thus will need to passed into predict.

To Reproduce

import numpy as np
import pandas as pd
from sktime.forecasting.fbprophet import Prophet
from sktime.forecasting.model_selection import temporal_train_test_split
from sktime.datasets import load_airline

y = load_airline()
y = y.to_timestamp(freq="M")
y_train, y_test = temporal_train_test_split(y, test_size=36)

y_train_df = pd.DataFrame(y_train)
y_train_df.columns = ["y"]
y_train_df["cap"] = 1000

cap = np.full_like(y_train_df["y"], 1000)

forecaster = Prophet(growth="logistic", growth_cap=cap)

forecaster.fit(y_train_df)

y_pred = forecaster.predict([1, 2, 3])

Expected behavior
y_pred with valid values.

Additional context
only fails if cap is array.

I'll continue looking into this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmodule:forecastingforecasting module: forecasting, incl probabilistic and hierarchical forecasting

    Type

    No type

    Projects

    Status

    Needs triage & validation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions