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

Closed
VargBurz opened this Issue Feb 20, 2019 · 0 comments

Comments

Projects
None yet
3 participants
@VargBurz
Copy link
Member

VargBurz commented Feb 20, 2019

C:\Users\VargB\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\stats\stats.py:3005: RuntimeWarning: Mean of empty slice.
  mx = x.mean()
C:\Users\VargB\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\core\_methods.py:80: 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\analytic_unit_manager.py", line 94, in handle_analytic_task
    result_payload = await self.__handle_analytic_task(task)
  File "C:\Users\VargB\git\hastic-server\analytics\bin\..\analytics\analytic_unit_manager.py", 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\analytic_unit_worker.py", line 28, in do_train
    new_cache: ModelCache = await self._training_feature
  File "C:\Users\VargB\AppData\Local\Programs\Python\Python36\lib\concurrent\futures\thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\VargB\git\hastic-server\analytics\bin\..\analytics\detectors\pattern_detector.py", line 46, in train
    new_cache = self.model.fit(dataframe, segments, cache)
  File "C:\Users\VargB\git\hastic-server\analytics\bin\..\analytics\models\model.py", line 86, in fit
    self.do_fit(dataframe, labeled, deleted, learning_info)
  File "C:\Users\VargB\git\hastic-server\analytics\bin\..\analytics\models\general_model.py", 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\common.py", 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\stats.py", 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
image
learning
in analytics we have data with 3285 values
image
segments indexes - 3139, 148
then label some pattern in right part of data
image
in analytics we have data with 2465 values
image
and value error
image

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.