Skip to content

Commit

Permalink
Update tsa.py
Browse files Browse the repository at this point in the history
  • Loading branch information
oualib committed Nov 8, 2023
1 parent f357b0d commit 214602d
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions verticapy/machine_learning/vertica/tsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,6 @@ def predict(
vDataFrame
a new object.
"""
ar_ma = False
if self._model_type in (
"AR",
"MA",
Expand All @@ -481,7 +480,6 @@ def predict(
ts = self.ts
if isinstance(y, NoneType):
y = self.y
ar_ma = True
if isinstance(start, (int, float)):
start_predict = int(start + 1)
else:
Expand All @@ -507,7 +505,7 @@ def predict(
j = j + start
elif not (isinstance(start, NoneType)):
j = start
if (output_standard_errors or output_estimated_ts) and not (ar_ma):
if (output_standard_errors or output_estimated_ts):
if not (output_standard_errors):
stde_out = ""
else:
Expand All @@ -516,13 +514,9 @@ def predict(
else:
output_standard_errors = ""
stde_out = ""
if ar_ma:
order_by = ""
else:
order_by = 'ORDER BY "std_err"'
sql = f"""
SELECT
ROW_NUMBER() OVER ({order_by}) + {j} - 1 AS idx,
ROW_NUMBER() OVER () + {j} - 1 AS idx,
prediction{output_standard_errors}
FROM ({sql}) VERTICAPY_SUBTABLE"""
if output_estimated_ts:
Expand Down

0 comments on commit 214602d

Please sign in to comment.