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]:
