https://github.com/nixtla logo
#neural-forecast
Title
# neural-forecast
v

virgilio espina

03/24/2023, 4:33 PM
Can you please assist me on this error? I am trying to replicate Automatic Hyperparameter Tuning using my dataset.
f

Farzad E

03/24/2023, 5:48 PM
Seems like you have different data types. Have you checked the types in your input data?
v

virgilio espina

03/24/2023, 5:59 PM
ds = object
how do i convert the data type to be readable?
f

Farzad E

03/24/2023, 6:02 PM
I don't know your whole code and data but in Pandas you can do
df['ds'] = pd.to_datetime(df['ds'])
v

virgilio espina

03/24/2023, 6:05 PM
still has an error. i am attaching my data....
f

Farzad E

03/24/2023, 6:17 PM
In that case you shouldn't actually have to convert anything. Not sure why you are not getting the right data type. Are you sure you had a fresh start in your notebook and didn't load any other libraries?
This is what I got right now:
If you do that you should get a date type to begin with. The data is already properly formatted.
v

virgilio espina

03/24/2023, 6:28 PM
I made a fresh start and same problem...
f

Farzad E

03/24/2023, 6:31 PM
Make sure you have the right package versions in your env. If a fresh start with only those lines of code (and nothing else) is still giving you an object type instead of datetime type, then your packages are not working properly. Perhaps you have installed a package in your env recently that has updated some shared dependencies with the neuralforecast and now things are not working. A freshly installed package with that code should work. I just tested on Mac with Python 3.10.6 and neuralforecast==1.4.0
c

Cristian (Nixtla)

03/24/2023, 7:17 PM
Hi @virgilio espina. If the
<http://pd.to|pd.to>_datetime
fails then there is an issue with the data. Maybe inconsistent dates formats. Can you try specifying the format (eg. YYYY-dd-mm)? You also need to specify the correct frequency when you instantiate the
NeuralForecast
class.
Month end in this case