VAR (Beta)¶
In [ ]:
VAR(name: str,
p: int = 0,
tol: float = 1e-4,
max_iter: int = 1000,
solver: str = "Newton")
Creates an VAR object using the Vertica linear regression function.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
name | str | ❌ | Name of the model to be stored in the database. |
p | int | ✓ | Order of the AR (Auto-Regressive) part. |
tol | float | ✓ | Determines whether the algorithm has reached the specified accuracy result. |
max_iter | int | ✓ | Determines the maximum number of iterations the algorithm performs before achieving the specified accuracy result. |
solver | str | ✓ | The optimizer method to use to train the model.
|
Attributes¶
When this object is created, all of its parameters become attributes. When fitting the model, the model will create additional attributes.:
| Name | Type | Description |
|---|---|---|
coef_ | list | Coefficients and their mathematical information (pvalue, std, value...) |
deploy_predict_ | list | SQL code used to deploy the model. |
input_relation | str | Training relation. |
ts | str | vcolumn used to order the data. |
X | list | List of the responses. |
test_relation | str | Relation to use to test the model. All model methods are abstractions that simplify the process. The testing relation will be used by the methods to evaluate the model. If empty, the training relation will be used instead. This attribute can be changed at any time. |
transform_relation | str | Relation used to deploy the model. |
Methods¶
| Name | Description |
|---|---|
| deploySQL | Returns the SQL code needed to deploy the model. |
| drop | Drops the model from the Vertica DB. |
| features_importance | Computes the model features importance using the Gini Index. |
| fit | Trains the model. |
| get_attr | Returns the model attribute. |
| get_params | Returns the model Parameters. |
| plot | Draws the SARIMAX model. |
| predict | Predicts using the input relation. |
| regression_report / report | Computes a regression report using multiple metrics to evaluate the model (r2, mse, max error...). |
| score | Computes the model score. |
| set_params | Sets the parameters of the model. |
Example¶
In [4]:
from verticapy.learn.tsa import VAR
model = VAR(name = "SARIMAX_cases",
tol = 1e-4,
max_iter = 100,
solver = 'BFGS',
p = 10)
display(model)
