SARIMAX (Beta)¶
In [ ]:
SARIMAX(name: str,
p: int = 0,
d: int = 0,
q: int = 0,
P: int = 0,
D: int = 0,
Q: int = 0,
s: int = 0,
tol: float = 1e-4,
max_iter: int = 1000,
solver: str = "Newton",
max_pik: int = 100,
papprox_ma: int = 200)
Creates an SARIMAX 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. |
d | int | ✓ | Order of the I (Integrated) part. |
q | int | ✓ | Order of the MA (Moving-Average) part. |
P | int | ✓ | Order of the seasonal AR (Auto-Regressive) part. |
D | int | ✓ | Order of the seasonal I (Integrated) part. |
Q | int | ✓ | Order of the seasonal MA (Moving-Average) part. |
s | int | ✓ | Span of the seasonality. |
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.
|
max_pik | int | ✓ | Number of inverse MA coefficient used to approximate the MA. |
papprox_ma | int | ✓ | the p of the AR(p) used to approximate the MA coefficients. |
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_ | tablesample | Coefficients and their mathematical information (pvalue, std, value...) |
ma_piq_ | tablesample | Moving Average Coefficients. |
ma_avg_ | float | Moving Average Intercept. |
deploy_predict_ | str | SQL code used to deploy the model. |
input_relation | str | Training relation. |
ts | str | vcolumn used to order the data. |
exogenous | str | exogenous columns. |
X | list | List of the predictors. |
y | str | Response column. |
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. |
| 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 [2]:
from verticapy.learn.tsa import SARIMAX
model = SARIMAX(name = "SARIMAX_cases",
tol = 1e-4,
max_iter = 100,
solver = 'BFGS',
p = 10,
max_pik = 100)
display(model)
