Comments (5)
division by zero
Get this error as well quite frequently,
StatsForecast(
models = [AutoARIMA(season_length = 3)],
freq = 'M')
unique_id ds y
40041 2021-10-01 2.607948
40041 2021-09-01 2.613875
40041 2021-08-01 2.646475
40041 2021-07-01 2.667220
40041 2021-06-01 2.673147
40041 2021-05-01 2.705746
40041 2021-04-01 2.693892
40041 2021-03-01 2.735382
40041 2021-02-01 2.690929
40041 2021-01-01 2.578313
unique_id
31179 2021-10-01 1.959469
31179 2021-09-01 1.972889
31179 2021-08-01 1.999731
31179 2021-07-01 1.972889
31179 2021-06-01 1.986311
31179 2021-05-01 2.013153
31179 2021-04-01 2.026574
31179 2021-03-01 2.133942
31179 2021-02-01 2.107100
31179 2021-01-01 2.133942
ds y
unique_id
22009 2021-10-01 1.516322
22009 2021-09-01 1.503445
22009 2021-08-01 1.513103
22009 2021-07-01 1.477690
22009 2021-06-01 1.464812
22009 2021-05-01 1.442277
22009 2021-04-01 1.422961
22009 2021-03-01 1.352135
22009 2021-02-01 1.348915
22009 2021-01-01 1.345696
ds y
unique_id
31105 2021-10-01 2.068724
31105 2021-09-01 2.068724
31105 2021-08-01 2.068724
31105 2021-07-01 2.033661
31105 2021-06-01 2.033661
31105 2021-05-01 2.103787
31105 2021-04-01 2.208976
31105 2021-03-01 2.279102
31105 2021-02-01 2.208976
31105 2021-01-01 2.664797
from statsforecast.
Hi @tackes! Would it be possible for you to share with us any time series that gives you the error? To try to replicate and debug it :)
from statsforecast.
The issue is with short time series. The below will return 2 errors -
- random_walk_with_drift will return a divide by zero error.
- arima will return math domain error
In the code sample, once removing the 'test' period, it will only have 1 data point to do calculations.
What would be a nice feature is if there was an option to 'ignore errors' and keep processing. This particular time series was on the 812th time series group out of 2000, but because it hit an error, the entire script stops running.
Even better is if there was a logging feature to store what and where the error occurred.
`data = {'unique_id': ['A','A','A','A','A'],
'y':[128050,4200,0,0,0],
'ds': pd.date_range(end='2021-09-01', periods=5, freq='M')}
series = pd.DataFrame(data,
columns =['unique_id','y','ds'])
series_test = test_df.groupby('unique_id').tail(horizon).copy()
series = test_df.drop(series_test.index)
series['unique_id'] = series['unique_id'].astype('object')
series = series.set_index('unique_id')
seasonality = 12 #Monthly data
models = [ random_walk_with_drift, auto_arima]
fcst = StatsForecast(df=series, models=models, freq='M', n_jobs=1)
forecasts = fcst.forecast(horizon)
forecasts.reset_index()`
from statsforecast.
@all-contributors please add @tackes for bug
from statsforecast.
I've put up a pull request to add @tackes! 🎉
from statsforecast.
Related Issues (20)
- Can statsforecast detect season_length automatically? HOT 2
- ValueError: xreg is rank deficient HOT 4
- Models: documented public methods/attributes to extract best parameters for Auto* models HOT 3
- Auto_Ces "Exception: no model able to be fitted" HOT 4
- Problem getting fitted values using cross validation with a spark dataframe HOT 2
- Problem using fit and predict or fit_predict using a spark dataframe HOT 1
- Model evaluation documentation asserts that datasetsforecast is required, but it isn't HOT 2
- Deprecate references to custom `evaluate_performace` function in favor of `utilsforecast.evaluation.evaluate`? HOT 2
- Should `forecast_fitted_values` also work for fitted models in addition to when forecast(fitted=True) is called? HOT 1
- Dead links for several pages in docs HOT 2
- MSTL can't use AutoETS as trend_forecaster HOT 1
- Can I use Exogenous features with AutoETS HOT 2
- statsforecast: prediction fails if more than one model uses fallbackheuristic HOT 2
- ARIMA fit asymmetrical var_coef for some parameters
- MSTL is very slow and not using all CPU cores at all HOT 2
- [Core StatsForecast] Bottom unbound confidence intervals?
- Problem with statsforecast mstl_decomposition HOT 2
- Theta Parameter to speed up training
- Exogenous Regressor having ValueError: could not broadcast input array from shape (53,3) into shape (52,3) HOT 8
- add feature importance for statsforecast models that accept exogenous features HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from statsforecast.