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

Naive Bayes Implementation Issue #1

Open
zirakkk opened this issue Feb 17, 2021 · 0 comments
Open

Naive Bayes Implementation Issue #1

zirakkk opened this issue Feb 17, 2021 · 0 comments

Comments

@zirakkk
Copy link
Contributor

zirakkk commented Feb 17, 2021

Getting this Error! Trying to fix it.

prediction = model.predict(pd_df_x_test)
Traceback (most recent call last):

File "", line 1, in
prediction = model.predict(pd_df_x_test)

File "C:\Users\Zirak\anaconda3\lib\site-packages\dask_ml\naive_bayes.py", line 73, in predict
jll = self._joint_log_likelihood(X)

File "C:\Users\Zirak\anaconda3\lib\site-packages\dask_ml\naive_bayes.py", line 115, in joint_log_likelihood
((X - self.theta
[i, :]) ** 2) / (self.sigma_[i, :]), 1

File "C:\Users\Zirak\anaconda3\lib\site-packages\pandas\core\ops_init_.py", line 660, in f
new_data = dispatch_to_series(self, other, op)

File "C:\Users\Zirak\anaconda3\lib\site-packages\pandas\core\ops_init_.py", line 265, in dispatch_to_series
bm = left._mgr.apply(array_op, right=right)

File "C:\Users\Zirak\anaconda3\lib\site-packages\pandas\core\internals\managers.py", line 404, in apply
applied = b.apply(f, **kwargs)

File "C:\Users\Zirak\anaconda3\lib\site-packages\pandas\core\internals\blocks.py", line 346, in apply
result = func(self.values, **kwargs)

File "C:\Users\Zirak\anaconda3\lib\site-packages\pandas\core\ops\array_ops.py", line 190, in arithmetic_op
res_values = na_arithmetic_op(lvalues, rvalues, op)

File "C:\Users\Zirak\anaconda3\lib\site-packages\pandas\core\ops\array_ops.py", line 143, in na_arithmetic_op
result = expressions.evaluate(op, left, right)

File "C:\Users\Zirak\anaconda3\lib\site-packages\pandas\core\computation\expressions.py", line 233, in evaluate
return _evaluate(op, op_str, a, b) # type: ignore

File "C:\Users\Zirak\anaconda3\lib\site-packages\pandas\core\computation\expressions.py", line 68, in _evaluate_standard
return op(a, b)

File "C:\Users\Zirak\anaconda3\lib\site-packages\dask\array\core.py", line 1257, in array_ufunc
return elemwise(numpy_ufunc, *inputs, **kwargs)

File "C:\Users\Zirak\anaconda3\lib\site-packages\dask\array\core.py", line 4004, in elemwise
broadcast_shapes(*shapes)

File "C:\Users\Zirak\anaconda3\lib\site-packages\dask\array\core.py", line 3963, in broadcast_shapes
raise ValueError(

ValueError: operands could not be broadcast together with shapes (36, 169) (256,)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant