Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Issue to configure Prophet #173

Open
ivan-marroquin opened this issue Oct 9, 2024 · 1 comment
Open

[BUG] Issue to configure Prophet #173

ivan-marroquin opened this issue Oct 9, 2024 · 1 comment

Comments

@ivan-marroquin
Copy link

Describe the bug
Thanks for such great package!

I am following the jupyter notebook 1_AnomalyFeatures. I get the following error when the Prophet model is configured:

TypeError: to_dict() missing 1 required positional argument: 'self'

To Reproduce
Just run the three first cells in the notebook

Expected behavior
Have the Prophet model configured without error

Screenshots
TypeError Traceback (most recent call last)
Cell In [35], line 32
28 # Prophet is a popular forecasting algorithm. Here, we specify that we would like
29 # to pre-processes the input time series by applying a difference transform,
30 # before running the model on it.
31 config3= ProphetDetectorConfig(transform= DifferenceTransform)
---> 32 model3= ProphetDetector(config3)

File ~/python_3.9.0/lib/python3.9/site-packages/merlion/models/forecast/prophet.py:124, in Prophet.init(self, config)
123 def init(self, config: ProphetConfig):
--> 124 super().init(config)
125 self.model = prophet.Prophet(
126 yearly_seasonality=self.yearly_seasonality,
127 weekly_seasonality=self.weekly_seasonality,
(...)
131 holidays=None if self.holidays is None else pd.DataFrame(self.holidays),
132 )

File ~/python_3.9.0/lib/python3.9/site-packages/merlion/models/forecast/base.py:79, in ForecasterBase.init(self, config)
78 def init(self, config: ForecasterConfig):
---> 79 super().init(config)
80 self.target_name = None
81 self.exog_dim = None
...
---> 67 value = value.to_dict()
68 elif isinstance(value, Enum):
69 value = value.name # Relies on there being an appropriate getter/setter!

TypeError: to_dict() missing 1 required positional argument: 'self'

Desktop (please complete the following information):

  • OS: Ubuntu 22.04.5 LTS
  • Merlion 2.0.4
  • Prophet 1.1.5
  • Pandas 2.2.2
  • Python
@AtanasGruev
Copy link

Hello, I was able to reproduce the error. In your case, note that the problem arises from incorrectly passing DifferenceTransform instead of DifferenceTransform() as the transform argument in ProphetDetectorConfig on line 31.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants