-1

Why I am I getting this error?

My guess is that I am using parameters that don't work together. This is my code and that's the error I am getting:

The dataframe is 'L12M' and it has only two columns, ds and y. The data resolution 5 mins and it has about 12 months' worth of data:

enter image description here

m = NeuralProphet(n_forecasts=(2*24*12),
n_lags=(2*7*24*12),
yearly_seasonality="auto",
weekly_seasonality="auto",  
daily_seasonality="auto", 
growth="off", seasonality_reg= 0.5, optimizer = 'SDG',
learning_rate = 0.1, n_changepoints="auto", changepoints_range = "auto" )
m.add_country_holidays("US", mode="additive") # lower_window=-1, upper_window=1
metrics = m.fit(L12M, freq="5min")

enter image description here

Moody
  • 35
  • 1
  • 8
  • Please do not post images of code or error messages - see how to create a [mre]. – desertnaut Aug 16 '22 at 14:22
  • This is just an image of the error, the code is written. As for the code, metrics = m.fit(L12M, freq="5min"). Use any dataset instead of L12M and set the freq to the freq of the data-set u have – Moody Aug 16 '22 at 16:36
  • I did read it! It says don't use image for code, which I didn't. I only added a pic of the error because I don't understand and don't know which part is important to mention and which is not, that's why I added an image of the error, and the rules didn't mention anything wrong about an image of the error. I adjusted my question to make it reproducible! – Moody Aug 16 '22 at 19:33
  • 'ds (datestamp) column should be of a format expected by Pandas, ideally YYYY-MM-DD for a date or YYYY-MM-DD HH:MM:SS for a timestamp' from this [source](https://facebook.github.io/prophet/docs/quick_start.html#python-api). It should be easily possible to change the data format with pandas. – Mariusmarten Aug 16 '22 at 20:00
  • The code works fine. Once I add optimizer = 'SDG' I get this error. If I add optimizer = 'AdamW' it works fine. I don't think it has to do with the date format – Moody Aug 16 '22 at 20:10
  • That is strange, but thanks for pointing out: please see [How to ask](https://stackoverflow.com/help/how-to-ask) ("***DO NOT post images of code, data, error messages, etc.***") and [Why should I not upload images of code/data/errors when asking a question?](https://meta.stackoverflow.com/a/285557/4685471) – desertnaut Aug 16 '22 at 20:43
  • 1
    Probably you meant to write `'SGD'`, not `'SDG'` (typo) - although it is not clear from the [documentation](https://neuralprophet.com/html/forecaster.html?highlight=optimizer) that this is a valid argument... – desertnaut Aug 19 '22 at 00:01
  • Thanks for looking into this, appreciate it. Within the same documentation they mentioned "SDG"and they said: "NeuralProphet offers to set two different values for optimizer, namely AdamW and SDG (stochastic gradient decsent)." Here is the link: https://neuralprophet.com/html/hyperparameter-selection.html – Moody Aug 19 '22 at 17:54
  • I just noticed that in the documentation they wrote the wrong acronym "SDG" and it should be "SGD". I will try this and see how if it would work. Good catch! – Moody Aug 19 '22 at 17:55
  • Wow, it worked! I think you should report it to the Facebook Neural Prophet team. Thanks! My mistake is that I copy paste the command to make sure nothing would be wrong – Moody Aug 19 '22 at 20:10

1 Answers1

0

Thanks to @desertnaut. He noticed that there is a typo in the Neural Prophet documentation. So it should be "SGD" not "SDG." Cheers!

Moody
  • 35
  • 1
  • 8