Model.predict

In [ ]:
Model.predict(vdf: (str, vDataFrame), 
              X: list = [], 
              ts: str = "", 
              nlead: int = 0, 
              name: list = [])

Predicts using the input relation.

Parameters

Name Type Optional Description
vdf
str / vDataFrame
❌
Object to use to run the prediction. It can also be a customized relation but you need to englobe it using an alias. For example "(SELECT 1) x" is correct whereas "(SELECT 1)" or "SELECT 1" are incorrect.
X
str
✓
List of the response columns.
ts
str
✓
vcolumn used to order the data.
nlead
int
✓
Number of records to predict after the last ts date.
name
list
✓
Names of the added vcolumn. If empty, names will be generated.

Returns

vDataFrame : object including the prediction.

Example

In [5]:
from verticapy.learn.tsa import VAR
from verticapy import *

amazon = vDataFrame("Texas")
model = VAR(name = "VAR_Texas",
            p = 5)
model.drop()
model.fit(input_relation = "Texas", 
          X = ["cases", "deaths"],
          ts = "date")
model.predict(amazon,
              nlead = 10,
              name = ["prediction_cases", "prediction_deaths"])
Out[5]:
📅
date
Timestamp
Abc
state
Varchar(48)
123
Numeric(179,161)
123
Numeric(178,160)
123
Numeric(195,176)
123
Numeric(195,177)
12020-02-12 00:00:00Texas
22020-02-13 00:00:00Texas
32020-02-14 00:00:00Texas
42020-02-15 00:00:00Texas
52020-02-16 00:00:00Texas
62020-02-17 00:00:00Texas
72020-02-18 00:00:00Texas
82020-02-19 00:00:00Texas
92020-02-20 00:00:00Texas
102020-02-21 00:00:00Texas
112020-02-22 00:00:00Texas
122020-02-23 00:00:00Texas
132020-02-24 00:00:00Texas
142020-02-25 00:00:00Texas
152020-02-26 00:00:00Texas
162020-02-27 00:00:00Texas
172020-02-28 00:00:00Texas
182020-02-29 00:00:00Texas
192020-03-01 00:00:00Texas
202020-03-02 00:00:00Texas
212020-03-03 00:00:00Texas
222020-03-04 00:00:00Texas
232020-03-05 00:00:00Texas
242020-03-06 00:00:00Texas
252020-03-07 00:00:00Texas
262020-03-08 00:00:00Texas
272020-03-09 00:00:00Texas
282020-03-10 00:00:00Texas
292020-03-11 00:00:00Texas
302020-03-12 00:00:00Texas
312020-03-13 00:00:00Texas
322020-03-14 00:00:00Texas
332020-03-15 00:00:00Texas
342020-03-16 00:00:00Texas
352020-03-17 00:00:00Texas
362020-03-18 00:00:00Texas
372020-03-19 00:00:00Texas
382020-03-20 00:00:00Texas
392020-03-21 00:00:00Texas
402020-03-22 00:00:00Texas
412020-03-23 00:00:00Texas
422020-03-24 00:00:00Texas
432020-03-25 00:00:00Texas
442020-03-26 00:00:00Texas
452020-03-27 00:00:00Texas
462020-03-28 00:00:00Texas
472020-03-29 00:00:00Texas
482020-03-30 00:00:00Texas
492020-03-31 00:00:00Texas
502020-04-01 00:00:00Texas
512020-04-02 00:00:00Texas
522020-04-03 00:00:00Texas
532020-04-04 00:00:00Texas
542020-04-05 00:00:00Texas
552020-04-06 00:00:00Texas
562020-04-07 00:00:00Texas
572020-04-08 00:00:00Texas
582020-04-09 00:00:00Texas
592020-04-10 00:00:00Texas
602020-04-11 00:00:00Texas
612020-04-12 00:00:00Texas
622020-04-13 00:00:00Texas
632020-04-14 00:00:00Texas
642020-04-15 00:00:00Texas
652020-04-16 00:00:00Texas
662020-04-17 00:00:00Texas
672020-04-18 00:00:00Texas
682020-04-19 00:00:00Texas
692020-04-20 00:00:00Texas
702020-04-21 00:00:00Texas
712020-04-22 00:00:00Texas
722020-04-23 00:00:00Texas
732020-04-24 00:00:00Texas
742020-04-25 00:00:00Texas
752020-04-26 00:00:00Texas
762020-04-27 00:00:00Texas
772020-04-28 00:00:00Texas
782020-04-29 00:00:00Texas
792020-04-30 00:00:00Texas
802020-05-01 00:00:00Texas
812020-05-02 00:00:00Texas
822020-05-03 00:00:00Texas
832020-05-04 00:00:00Texas
842020-05-05 00:00:00Texas
852020-05-06 00:00:00Texas
862020-05-07 00:00:00Texas
872020-05-08 00:00:00Texas
882020-05-09 00:00:00Texas
892020-05-10 00:00:00[null]
902020-05-11 00:00:00[null]
912020-05-12 00:00:00[null]
922020-05-13 00:00:00[null]
932020-05-14 00:00:00[null]
942020-05-15 00:00:00[null]
952020-05-16 00:00:00[null]
962020-05-17 00:00:00[null]
972020-05-18 00:00:00[null]
982020-05-19 00:00:00[null]
Rows: 1-98 | Columns: 6