AutoViML / Auto_TS

Automatically build ARIMA, SARIMAX, VAR, FB Prophet and XGBoost Models on Time Series data sets with a Single Line of Code. Created by Ram Seshadri. Collaborators welcome.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

__init__.py creating a a.any() and a.all() error message

BernardOng opened this issue · comments

During a model.fit() run, while doing an Auto Sarimax and encountering a possible np.inf event, it produces this error which halts the run:

`---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in
----> 1 model.fit(traindata=train_df, ts_column="Date", target="Sales", cv=3)

D:\Anaconda3\envs\ve_autots\lib\site-packages\auto_ts_init_.py in fit(self, traindata, ts_column, target, sep, cv)
750 print(f"Total time taken: {elapsed:.0f} seconds.")
751 print("-"*50 + "\n\n")
--> 752 print("Leaderboard with best model on top of list:\n",self.get_leaderboard())
753 return self
754

D:\Anaconda3\envs\ve_autots\lib\site-packages\auto_ts_init_.py in get_leaderboard(self, ascending)
893 cv_scores = model_dict_single_model.get(self.score_type)
894 #### This is quite complicated since we have to make sure it doesn't blow up
--> 895 if cv_scores == np.inf:
896 mean_cv_score = np.inf
897 elif isinstance(cv_scores, list):

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()`

I fixed the issue by changing file init.py, source code line 895,

From this:
if cv_scores == np.inf:

to this:
if np.any(cv_scores) == np.inf:

@BernardOng 👍

Thank you very much for the comment and change. I have made the change and it is in version 0.0.37

To upgrade to this latest version please do:
pip install auto_ts --upgrade

Thanks again