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] Bug report ValueError: Shape of passed values is (249, 150), indices imply (249, 152) #83

Open
kurvaraviteja355 opened this issue Sep 27, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@kurvaraviteja355
Copy link

Describe the bug
For Hierarchical Time Series forecasting, I used the hts-regressor but when i fit the model for the dataframe it works very well without any bugs but when i try to make the prediction after the fitting the model it throughs the value error, I didn`t make any changes to the dataset. the error is shown below and same error for the prophet model as too

ValueError Traceback (most recent call last)
C:\Users\RAVITE~1.KUR\AppData\Local\Temp/ipykernel_14244/3328185665.py in
1 model_bu_arima = hts.HTSRegressor(model='auto_arima', revision_method='BU', n_jobs=0)
2 model_bu_arima = model_bu_arima.fit(dataset_MMAachen, hierarchy)
----> 3 pred_bu_arima = model_bu_arima.predict(steps_ahead=4)

~\Anaconda3\envs\Microsoft\lib\site-packages\hts\core\regressor.py in predict(self, exogenous_df, steps_ahead, distributor, disable_progressbar, show_warnings, **predict_kwargs)
350 self.hts_result.errors = (key, error)
351 self.hts_result.residuals = (key, residual)
--> 352 return self._revise(steps_ahead=steps_ahead)
353
354 def _revise(self, steps_ahead: int = 1) -> pandas.DataFrame:

~\Anaconda3\envs\Microsoft\lib\site-packages\hts\core\regressor.py in _revise(self, steps_ahead)
362 revised_columns = list(make_iterable(self.nodes))
363 revised_index = self._get_predict_index(steps_ahead=steps_ahead)
--> 364 return pandas.DataFrame(revised, index=revised_index, columns=revised_columns)
365
366 def _get_predict_index(self, steps_ahead=1) -> Any:

~\Anaconda3\envs\Microsoft\lib\site-packages\pandas\core\frame.py in init(self, data, index, columns, dtype, copy)
670 )
671 else:
--> 672 mgr = ndarray_to_mgr(
673 data,
674 index,

~\Anaconda3\envs\Microsoft\lib\site-packages\pandas\core\internals\construction.py in ndarray_to_mgr(values, index, columns, dtype, copy, typ)
322 )
323
--> 324 _check_values_indices_shape_match(values, index, columns)
325
326 if typ == "array":

~\Anaconda3\envs\Microsoft\lib\site-packages\pandas\core\internals\construction.py in _check_values_indices_shape_match(values, index, columns)
391 passed = values.shape
392 implied = (len(index), len(columns))
--> 393 raise ValueError(f"Shape of passed values is {passed}, indices imply {implied}")
394
395

ValueError: Shape of passed values is (249, 150), indices imply (249, 152)

Desktop (please complete the following information):

  • OS: [e.g. Windows 10]
  • scikit-hts version: [0.5.2]
  • Python version: [e.g. 3.9
    error
    ]

Additional context
Add any other context about the problem here.

@kurvaraviteja355 kurvaraviteja355 added the bug Something isn't working label Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant