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

Update naive_bayes.py #784

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion verticapy/machine_learning/vertica/naive_bayes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from verticapy._utils._sql._collect import save_verticapy_logs
from verticapy._utils._sql._format import quote_ident
from verticapy._utils._sql._vertica_version import check_minimum_version
from verticapy.errors import MissingRelation

from verticapy.core.vdataframe.base import vDataFrame

Expand Down Expand Up @@ -593,7 +594,10 @@ def _get_nb_attributes(self) -> list[dict]:
Returns a list of dictionary for each of the NB
variables. It is used to translate NB to Python.
"""
vdf = vDataFrame(self.input_relation)
try:
vdf = vDataFrame(self.input_relation)
except MissingRelation:
return []
var_info = {}
gaussian_incr, bernoulli_incr, multinomial_incr = 0, 0, 0
for idx, elem in enumerate(self.X):
Expand Down