Fit error "B[1] is -nan, but most not be nan!"
- Ngôn ngữ chính
- Python
- Star
- 20.4k
- Fork
- 4.6k
- Merge trung bình
- 19 giờ 52 phút
- Pull request đã merge (30 ngày)
- 1
Mô tả
From @humphreyapplebee:
I was able to find another example of a series that exhibits this behaviour:
```
from fbprophet import Prophet
import pandas as pd
y = [800, 5700, 8200, 5413, 19035, 14841, 12935, 18518, 28402, 73898, 125483, 11353, 135, 650, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 502, 377, 125, 984, 851, 127, 2914, 1073, 1339, 3468, 4813, 203, 0, 0, 0]
periods = len(y)
dates = pd.date_range(start='2018-02-05', freq='W-MON', periods=periods)
floor = [0] * periods
cap = [484.6442413330078] * periods
df = pd.DataFrame({
"ds": dates,
"y": y,
"floor": floor,
"cap": cap
})
model = Prophet(
daily_seasonality=False,
weekly_seasonality=True,
yearly_seasonality=True,
seasonality_mode="multiplicative",
changepoint_prior_scale=0.05,
growth="logistic"
)
```
With LBGFS (i.e. `model.fit(df, algorithm='LBFGS')`), the training stalls as described above. Interestingly, training no longer stalls when I modify the number of changepoints (either adding more or less) or perturb the training data even very slightly (e.g. by dropping a significant figure from one of the dates).
With Newton (i.e. `model.fit(df, algorithm='Newton')`), I receive the following exception:
```
WARNING:fbprophet:Optimization terminated abnormally. Falling back to Newton.
...
vendor/local/lib/python2.7/site-packages/pystan/model.pyc in optimizing(self, data, seed, init, sample_file, algorithm, verbose, as_vector, **kwargs)
548 stan_args = pystan.misc._get_valid_stan_args(stan_args)
549
--> 550 ret, sample = fit._call_sampler(stan_args)
551 pars = pystan.misc._par_vector2dict(sample['par'], m_pars, p_dims)
552 if not as_vector:
stanfit4anon_model_861b75c6337e237650a61ae58c4385ef_8369643458939391769.pyx in stanfit4anon_model_861b75c6337e237650a61ae58c4385ef_8369643458939391769.StanFit4Model._call_sampler()
stanfit4anon_model_861b75c6337e237650a61ae58c4385ef_8369643458939391769.pyx in stanfit4anon_model_861b75c6337e237650a61ae58c4385ef_8369643458939391769._call_sampler()
RuntimeError: Exception: Exception: multiply: B[1] is -nan, but must not be nan!
````
_Originally posted by @humphreyapplebee in https://github.com/facebook/prophet/issues/842#issuecomment-504472349_
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.