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

ValueError: operands could not be broadcast together with shapes #425

VargBurz opened this Issue Feb 20, 2019 · 0 comments


None yet
3 participants
Copy link

VargBurz commented Feb 20, 2019

C:\Users\VargB\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\stats\ RuntimeWarning: Mean of empty slice.
  mx = x.mean()
C:\Users\VargB\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\core\ RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
2019-02-20 11:00:53,158 [Analytics] [ERROR]  handle_analytic_task Exception: 'Traceback (most recent call last):
  File "C:\Users\VargB\git\hastic-server\analytics\bin\..\analytics\", line 94, in handle_analytic_task
    result_payload = await self.__handle_analytic_task(task)
  File "C:\Users\VargB\git\hastic-server\analytics\bin\..\analytics\", line 82, in __handle_analytic_task
    return await worker.do_train(payload['segments'], data, payload['cache'])
  File "C:\Users\VargB\git\hastic-server\analytics\bin\..\analytics\", line 28, in do_train
    new_cache: ModelCache = await self._training_feature
  File "C:\Users\VargB\AppData\Local\Programs\Python\Python36\lib\concurrent\futures\", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\VargB\git\hastic-server\analytics\bin\..\analytics\detectors\", line 46, in train
    new_cache =, segments, cache)
  File "C:\Users\VargB\git\hastic-server\analytics\bin\..\analytics\models\", line 86, in fit
    self.do_fit(dataframe, labeled, deleted, learning_info)
  File "C:\Users\VargB\git\hastic-server\analytics\bin\..\analytics\models\", line 49, in do_fit
    correlation_list = utils.get_correlation(self.state['pattern_center'], self.state['pattern_model'], data, self.state['WINDOW_SIZE'])
  File "C:\Users\VargB\git\hastic-server\analytics\bin\..\analytics\utils\", line 230, in get_correlation
    correlation = pearsonr(labeled_segment, av_model)
  File "C:\Users\VargB\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\stats\", line 3008, in pearsonr
    r_num = np.add.reduce(xm * ym)
ValueError: operands could not be broadcast together with shapes (0,) (9,)

Steps to reproduce:
Label 2 segments far from each other
in analytics we have data with 3285 values
segments indexes - 3139, 148
then label some pattern in right part of data
in analytics we have data with 2465 values
and value error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.