business-science / modeltime.gluonts

GluonTS Deep Learning with Modeltime
https://business-science.github.io/modeltime.gluonts/
Other
39 stars 9 forks source link

Error in the package nbeats env #60

Open AparnaSN opened 9 months ago

AparnaSN commented 9 months ago

I am getting the error in the environment:

Error in purrr::map(., .f = function(df) { : ℹ In index: 1. Caused by error in pkg.env$pd$Timestamp(): ! attempt to apply non-function Error in purrr::map(): Error in purrr::map(): ℹ In index: 1. Caused by error in pkg.env$pd$Timestamp(): ! attempt to apply non-function

I have been using the package for a while. suddenly this error popping up. Please help

mdancho84 commented 9 months ago

It looks like pandas Timestamp() method is not being found.

What python packages are in your environment that modeltime GluonTS is using?

AparnaSN commented 9 months ago

When I loaded tidyverse package error disappered. But not sure how it worked before. Tm

On Tue, 20 Feb 2024 at 5:19 PM, Matt Dancho @.***> wrote:

It looks like pandas Timestamp() method is not being found.

What python packages are in your environment that modeltime GluonTS is using?

— Reply to this email directly, view it on GitHub https://github.com/business-science/modeltime.gluonts/issues/60#issuecomment-1954049185, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALSDG4CU6MNO4GNV4R6JEHTYUSETFAVCNFSM6AAAAABDQXQI2OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJUGA2DSMJYGU . You are receiving this because you authored the thread.Message ID: @.***>

AparnaSN commented 4 days ago

Any workaround for this ? I am getting the same error above. I could able to install and load model time.gluonts, tidymodels,tidyverse and timetk . When I try to call nbeats function created it causing the issue

mdancho84 commented 4 days ago

Modeltime gluonts will internally load pandas as pd then it attempts to use the pd.Timestamp() function. So you need to make sure that pandas is installed in the modeltime gluonts python environment being used, and make sure this function exists.

AparnaSN commented 4 days ago

I could see the pandas being installed in the environment. How do I make sure that the pd.Timestamp() function is loaded correctly

AparnaSN commented 3 days ago

@mdancho84 I think the pandas is installed
All requested packages are showing as installed.

But I think it is not able to call the pkg.env$pd$Timestamp() function

mdancho84 commented 3 days ago

Which python environment is modeltime gluonts connected to?

AparnaSN commented 3 days ago

The environment is : environment location: /root/.local/share/r-miniconda/envs/r-gluonts

Also, reticulate::py_discover_config() is returning:

python: /databricks/python3/bin/python libpython: /usr/lib/python3.9/config-3.9-x86_64-linux-gnu/libpython3.9.so pythonhome: /databricks/python3:/databricks/python3 virtualenv: /databricks/python3/bin/activate_this.py version: 3.9.19 (main, Apr 6 2024, 17:57:55) [GCC 9.4.0] numpy: /databricks/python3/lib/python3.9/site-packages/numpy numpy_version: 1.21.5 numpy: /databricks/python3/lib/python3.9/site-packages/numpy

AparnaSN commented 2 days ago

@mdancho84 I think when i start the new session, and when uses library(reticulate), it forces the python to reticulate environment but not the environment where r-gluonts is there. I tries to change the environment, but still it shows the reticulate environment. It was working before as expected. Any solution for this ?

mdancho84 commented 2 days ago

That could be the issue. In RStudio you can select in the project scope which Python environment to use for reticulate. I suggest you do this. See this article: https://support.posit.co/hc/en-us/articles/1500007929061-Using-Python-with-the-RStudio-IDE

AparnaSN commented 2 days ago

@mdancho84 I am using Azure databricks not the R studio.

mdancho84 commented 2 days ago

You can programmatically force the python environment https://rstudio.github.io/reticulate/articles/versions.html

AparnaSN commented 1 day ago

@mdancho84 I tried changing the environment but still the issue with timestamp is showing up. Error in purrr::map(., .f = function(df) { : ℹ In index: 1. Caused by error in pkg.env$pd$Timestamp(): ! attempt to apply non-function Error in purrr::map(): Error in purrr::map(): ℹ In index: 1. Caused by error in pkg.env$pd$Timestamp(): ! attempt to apply non-function

AparnaSN commented 1 day ago

@mdancho84 Also tried to change the date column df$Date <- as.Date(df$Date) as_pandas_timestamp(df$Date)

Now the error message is different. Error in pkg.env$pd$Timestamp(number_date,…). attempt to apply non-function. Do I need to do some changes related to time zone? Is this anything related to day light savings since it was working before ?

AparnaSN commented 3 hours ago

@mdancho84 I am kind of stuck with this issue for more than a week. Any leads would help. There an no installation or environment issue . I think the issue is something related to the input date . But no format changes done for the input

mdancho84 commented 2 hours ago

I apologize. I don't have time to fix it. ChatGPT is where I would go to troubleshoot.