Giter Site home page Giter Site logo

Comments (5)

blazespinnaker avatar blazespinnaker commented on July 20, 2024 1

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.

AzulGarza avatar AzulGarza commented on July 20, 2024

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.

tackes avatar tackes commented on July 20, 2024

The issue is with short time series. The below will return 2 errors -

  1. random_walk_with_drift will return a divide by zero error.
  2. 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.

mergenthaler avatar mergenthaler commented on July 20, 2024

@all-contributors please add @tackes for bug

from statsforecast.

allcontributors avatar allcontributors commented on July 20, 2024

@mergenthaler

I've put up a pull request to add @tackes! 🎉

from statsforecast.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.