Open martinezsebastian opened 3 years ago
Hi! I am trying to use the hierarchical model hts.HTSRegressor, but when I try to fit my model I get the following error:
Fitting models: 0%| | 0/72 [00:00<?, ?it/s] --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-40-2f068243babc> in <module> ----> 1 model = clf.fit(hierar_data, hierarchy) ~/anaconda3/lib/python3.7/site-packages/hts/core/regressor.py in fit(self, df, nodes, tree, exogenous, root, distributor, disable_progressbar, show_warnings, **fit_kwargs) 236 disable_progressbar=disable_progressbar, 237 show_warnings=show_warnings, --> 238 distributor=distributor, 239 ) 240 ~/anaconda3/lib/python3.7/site-packages/hts/core/utils.py in _do_fit(nodes, function_kwargs, n_jobs, disable_progressbar, show_warnings, distributor) 38 39 result = distributor.map_reduce( ---> 40 _do_actual_fit, data=nodes, function_kwargs=function_kwargs 41 ) 42 distributor.close() ~/anaconda3/lib/python3.7/site-packages/hts/utilities/distribution.py in map_reduce(self, map_function, data, function_kwargs, chunk_size, data_length) 174 ) 175 --> 176 result = list(itertools.chain.from_iterable(result)) 177 178 return result ~/anaconda3/lib/python3.7/site-packages/tqdm/std.py in __iter__(self) 1183 1184 try: -> 1185 for obj in iterable: 1186 yield obj 1187 # Update and possibly print the progressbar. ~/anaconda3/lib/python3.7/site-packages/hts/utilities/distribution.py in _function_with_partly_reduce(chunk_list, map_function, kwargs) 39 kwargs = kwargs or {} 40 results = (map_function(chunk, kwargs) for chunk in chunk_list) ---> 41 return list(results) 42 43 ~/anaconda3/lib/python3.7/site-packages/hts/utilities/distribution.py in <genexpr>(.0) 38 39 kwargs = kwargs or {} ---> 40 results = (map_function(chunk, kwargs) for chunk in chunk_list) 41 return list(results) 42 ~/anaconda3/lib/python3.7/site-packages/hts/core/utils.py in _do_actual_fit(node, function_kwargs) 48 node=node, 49 transform=function_kwargs["transform"], ---> 50 **function_kwargs["model_args"] 51 ) 52 if not function_kwargs["low_memory"]: ~/anaconda3/lib/python3.7/site-packages/hts/model/ar.py in __init__(self, node, **kwargs) 39 40 def __init__(self, node: HierarchyTree, **kwargs): ---> 41 super().__init__(ModelT.auto_arima.name, node, **kwargs) 42 43 def fit(self, **fit_args) -> "TimeSeriesModel": ~/anaconda3/lib/python3.7/site-packages/hts/model/base.py in __init__(self, kind, node, transform, **kwargs) 44 self.node = node 45 self.transform_function = self._set_transform(transform=transform) ---> 46 self.model = self.create_model(**kwargs) 47 self.forecast = None 48 self.residual = None ~/anaconda3/lib/python3.7/site-packages/hts/model/base.py in create_model(self, **kwargs) 97 elif self.kind == ModelT.auto_arima.name: 98 try: ---> 99 from pmdarima import AutoARIMA 100 except ImportError: # pragma: no cover 101 logger.error( ~/anaconda3/lib/python3.7/site-packages/pmdarima/__init__.py in <module> 49 50 # Stuff we want at top-level ---> 51 from .arima import auto_arima, ARIMA, AutoARIMA, StepwiseContext, decompose 52 from .utils import acf, autocorr_plot, c, pacf, plot_acf, plot_pacf, \ 53 tsdisplay ~/anaconda3/lib/python3.7/site-packages/pmdarima/arima/__init__.py in <module> 3 # Author: Taylor Smith <taylor.smith@alkaline-ml.com> 4 ----> 5 from .approx import * 6 from .arima import * 7 from .auto import * ~/anaconda3/lib/python3.7/site-packages/pmdarima/arima/approx.py in <module> 7 import numpy as np 8 ----> 9 from ..utils.array import c, check_endog 10 from ..utils import get_callable 11 from ..compat.numpy import DTYPE ~/anaconda3/lib/python3.7/site-packages/pmdarima/utils/__init__.py in <module> 3 # Author: Taylor Smith <taylor.smith@alkaline-ml.com> 4 ----> 5 from .array import * 6 from .metaestimators import * 7 from .visualization import * ~/anaconda3/lib/python3.7/site-packages/pmdarima/utils/array.py in <module> 11 12 from ..compat import DTYPE ---> 13 from ._array import C_intgrt_vec 14 15 __all__ = [ pmdarima/utils/_array.pyx in init pmdarima.utils._array() ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
I am using python 3.7.3, but have tried with 3.8 and 3.9, and nothing seems to work. Any ideas as to what might be happening?
Thank you in advance! Sebastián
Hi! I am trying to use the hierarchical model hts.HTSRegressor, but when I try to fit my model I get the following error:
I am using python 3.7.3, but have tried with 3.8 and 3.9, and nothing seems to work. Any ideas as to what might be happening?
Thank you in advance! Sebastián