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
local variable 'mean_cv_score' referenced before assignment #42
Comments
I have fixed this error in the ;latest version. Please pip install upgrade like this: $ pip install auto-ts --upgrade --user This should fix it - if not, please reopen it. |
UnboundLocalError Traceback (most recent call last) ~\Anaconda3\envs\test\lib\site-packages\auto_ts_init_.py in fit(self, traindata, ts_column, target, sep, cv) ~\Anaconda3\envs\test\lib\site-packages\auto_ts_init_.py in get_leaderboard(self, ascending) UnboundLocalError: local variable 'mean_cv_score' referenced before assignment |
Hello:I found the error and fixed it. Please upgrade via:
$ pip install auto-ts --upgrade
If you see the version number 0.0.36, it should work.Thanks for your patienceRam
On Friday, March 12, 2021, 1:22:52 AM EST, ssth81456 ***@***.***> wrote:
fe02913
UnboundLocalError Traceback (most recent call last)
in
4 target=target,
5 cv=3,
----> 6 sep=sep)
~\Anaconda3\envs\test\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
~\Anaconda3\envs\test\lib\site-packages\auto_ts_init_.py in get_leaderboard(self, ascending)
904 # else: # Assuming List
905 # mean_cv_score = sum(cv_scores)/len(cv_scores)
--> 906 mean_cv_scores.append(mean_cv_score)
907
908 results = pd.DataFrame({"name": names, self.score_type: mean_cv_scores})
UnboundLocalError: local variable 'mean_cv_score' referenced before assignment
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Thanks, updated to 0.0.36 and the issue is solved now. |
UnboundLocalError Traceback (most recent call last)
in
----> 1 model.fit( traindata=df_after, ts_column='Timestamp',target='Weighted_Price')
/usr/local/lib/python3.8/dist-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
/usr/local/lib/python3.8/dist-packages/auto_ts/init.py in get_leaderboard(self, ascending)
904 # else: # Assuming List
905 # mean_cv_score = sum(cv_scores)/len(cv_scores)
--> 906 mean_cv_scores.append(mean_cv_score)
907
908 results = pd.DataFrame({"name": names, self.score_type: mean_cv_scores})
UnboundLocalError: local variable 'mean_cv_score' referenced before assignment
So I think the problem is around line 898 in init.py
897 elif isinstance(cv_scores, list): 898 if len(cv_scores) == 0: 899 mean_cv_score = np.inf 900 else: 901 mean_cv_score = self.__get_mean_cv_score(cv_scores) 902 # if isinstance(cv_scores, float): 903 # mean_cv_score = cv_scores 904 # else: # Assuming List 905 # mean_cv_score = sum(cv_scores)/len(cv_scores)
because it doesn't assign the value of mean_cv_score if len(cv_scores) is not equal to 0,I'm not an expert to this frame, but I saw a comment in line 905 says 'assuming list',maybe should put it below 899 like
897 elif isinstance(cv_scores, list): 898 if len(cv_scores) == 0: 899 mean_cv_score = np.inf 900 else: 901 mean_cv_score = sum(cv_scores)/len(cv_scores)
Just my guess
The text was updated successfully, but these errors were encountered: