| |
Methods defined here:
- __init__(self, data=None, orders_table=None, timestamp_columns=None, value_column=None, order=None, seasonal=None, period=None, include_mean=False, partition_columns=None, max_iterations=10000, method='SSE', include_drift=False, order_p=None, order_d=None, order_q=None, seasonal_order_p=None, seasonal_order_d=None, seasonal_order_q=None, data_sequence_column=None, orders_table_sequence_column=None)
- DESCRIPTION:
The Arima function calculates the coefficients for a sequence of
parameters, producing an ARIMA model that is typically input to the
function ArimaPredict.
PARAMETERS:
data:
Required Argument.
Specifies the name of the teradataml DataFrame that contains
the input parameters.
orders_table:
Optional Argument.
Specifies the name of the orders teradataml DataFrame that is
generated by TimeSeriesOrders function.
timestamp_columns:
Required Argument.
Specifies the names of the input_table columns that specify the
sequence (time points) of the input parameters. The sequence must
have uniform intervals.
Types: str OR list of Strings (str)
value_column:
Required Argument.
Specifies the name of the column that contains the time series data
in input_table.
Types: str
order:
Optional Argument.
Specifies the values of the non-seasonal orders p, d, and q for the
ARIMA model. The p and q must be an integer between 0 and 10,
inclusive. The d must be between 0 and 1, inclusive.
Types: str
seasonal:
Optional Argument.
Specifies the values of the seasonal orders sp, sd, and sq for the
ARIMA model. The sp and sq must be an integer between 0 and 10,
inclusive. The sd must be between 0 and 3, inclusive
Types: str
period:
Optional Argument.
Specifies the period of a season (m in the formula). This value must
be a positive integer value. If you specify seasonal, then you must
also specify period.
Types: int
include_mean:
Optional Argument.
Specifies whether the function adds the mean value (c in the formula)
to the Arima model.
Note: If include_mean is True, then both d
in Orders and sd in seasonal must be 0.
Default Value: False
Types: bool
partition_columns:
Optional Argument.
Specifies the partition columns that will be passed to the output. If
not specified, the output will not contain partition columns.
Types: str OR list of Strings (str)
max_iterations:
Optional Argument.
Specifies the maximum iteration number for estimating the parameters.
This value must be a positive integer.
Default Value: 10000
Types: int
method:
Optional Argument.
Specifies the method for fitting the model parameters: SSE (Default):
Sum of squared error. ML: Maximum likelihood
Default Value: "SSE"
Permitted Values: SSE, ML
Types: str
include_drift:
Optional Argument.
Specifies whether drift term is included in the ARIMA model.
Note: This argument can only be True when d is non-zero and less than 2.
Default Value: False
Types: bool
order_p:
Optional Argument.
Specifies the p value of the non-seasonal order parameter. The p value must be
an integer between 0 and 10, inclusive.
Types: int
order_d:
Optional Argument.
Specifies the d value of the non-seasonal order parameter. The d value must be
an integer between 0 and 1, inclusive.
Types: int
order_q:
Optional Argument.
Specifies the q value of the non-seasonal order parameter. The q value must be
an integer between 0 and 10, inclusive.
Types: int
seasonal_order_p:
Optional Argument.
Specifies the sp value of the seasonal order parameter. The sp value must be an
integer between 0 and 10, inclusive.
Types: int
seasonal_order_d:
Optional Argument.
Specifies the sd value of the seasonal order parameter. The sd value must be an
integer between 0 and 3, inclusive.
Types: int
seasonal_order_q:
Optional Argument.
Specifies the sq value of the seasonal order parameter. The sq value must be an
integer between 0 and 10, inclusive.
Types: int
data_sequence_column:
Optional Argument.
Specifies the list of column(s) that uniquely identifies each row of
the input argument "data". The argument is used to ensure
deterministic results for functions which produce results that vary
from run to run.
Types: str OR list of Strings (str)
orders_table_sequence_column:
Optional Argument.
Specifies the list of column(s) that uniquely identifies each row of
the input argument "orders_table". The argument is used to ensure
deterministic results for functions which produce results that vary
from run to run.
Types: str OR list of Strings (str)
RETURNS:
Instance of Arima.
Output teradataml DataFrames can be accessed using attribute
references, such as ArimaObj.<attribute_name>.
Output teradataml DataFrame attribute names are:
1. coefficient
2. residual_table
3. output
RAISES:
TeradataMlException
EXAMPLES:
# Load the data to run the example.
load_example_data("arima", "milk_timeseries")
# Create teradataml DataFrame objects.
milk_timeseries = DataFrame.from_table("milk_timeseries")
# Example 1 - Generate Arima model using only orders paremeter without partition_columns and seasonal parameters.
arima_out1 = Arima(data = milk_timeseries,
timestamp_columns = ["period"],
value_column = "milkpound",
order = "0,1,2",
include_drift=True)
# Print the output data
print(arima_out1.coefficient)
print(arima_out1.residual_table)
print(arima_out1.output)
# Example 2 - Generate Arima model using seasonal orders parameter.
arima_out2 = Arima(data = milk_timeseries,
timestamp_columns = ["period"],
value_column = "milkpound",
order = "0,1,2",
seasonal_order_p = 0,
seasonal_order_d = 1,
seasonal_order_q = 1,
period = 12)
# Print output DataFrames individually.
print(arima_out2.coefficient)
print(arima_out2.residual_table)
print(arima_out2.output)
- __repr__(self)
- Returns the string representation for a Arima class instance.
- get_build_time(self)
- Function to return the build time of the algorithm in seconds.
When model object is created using retrieve_model(), then the value returned is
as saved in the Model Catalog.
- get_prediction_type(self)
- Function to return the Prediction type of the algorithm.
When model object is created using retrieve_model(), then the value returned is
as saved in the Model Catalog.
- get_target_column(self)
- Function to return the Target Column of the algorithm.
When model object is created using retrieve_model(), then the value returned is
as saved in the Model Catalog.
- show_query(self)
- Function to return the underlying SQL query.
When model object is created using retrieve_model(), then None is returned.
|