| |
Methods defined here:
- __init__(self, object=None, residual_table=None, n_ahead=1, partition_columns=None, object_sequence_column=None, residual_table_sequence_column=None, object_partition_column=None, residual_table_partition_column=None, object_order_column=None, residual_table_order_column=None)
- DESCRIPTION:
The ArimaPredict function takes as input the ARIMA model produced
by the function Arima and predicts a specified number of future
values (time point forecasts) for the modeled sequence.
PARAMETERS:
object:
Required Argument.
Specifies the name of the teradataml DataFrame that contains the
model. Such model is generated by Arima function, accessed using
coefficient (ArimaOuptutObj.coefficient). It can also accept Arima object
as it's input.
object_partition_column:
Required Argument.
Specifies Partition By columns for object.
Values to this argument can be provided as list, if multiple columns
are used for partition.
Types: str OR list of Strings (str)
object_order_column:
Optional Argument.
Specifies Order By columns for object.
Values to this argument can be provided as list, if multiple columns
are used for ordering.
Types: str OR list of Strings (str)
residual_table:
Required Argument.
Specifies the name of the teradataml DataFrame that contains the
original input parameters and their residuals. Such object is generated
by the Arima function and accessed using name residual_table.
residual_table_partition_column:
Required Argument.
Specifies Partition By columns for residual_table.
Values to this argument can be provided as list, if multiple columns
are used for partition.
Types: str OR list of Strings (str)
residual_table_order_column:
Required Argument.
Specifies Order By columns for residual_table.
Values to this argument can be provided as list, if multiple columns
are used for ordering.
Types: str OR list of Strings (str)
n_ahead:
Optional Argument.
Specifies the number of steps to forecast after the end of the time
series. This value must be a positive integer.
Default Value: 1
Types: int
partition_columns:
Required Argument.
Specifies the partition columns that are in model teradataml
DataFrame and residual table.
Types: str OR list of Strings (str)
object_sequence_column:
Optional Argument.
Specifies the list of column(s) that uniquely identifies each row of
the input argument "object". 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)
residual_table_sequence_column:
Optional Argument.
Specifies the list of column(s) that uniquely identifies each row of
the input argument "residual_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 ArimaPredict.
Output teradataml DataFrames can be accessed using attribute
references, such as ArimaPredictObj.<attribute_name>.
Output teradataml DataFrame attribute name is:
result
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")
# Generate arima model using order parameter.
arima_out = Arima(data = milk_timeseries,
timestamp_columns = "period",
value_column = "milkpound",
order = "3,0,0",
include_mean = True)
# Example 1: Using the generated Arima model to find predictions.
arima_predict_out1 = ArimaPredict(object = arima_out,
object_partition_column='td_arima_partition_id',
residual_table=arima_out.residual_table,
residual_table_partition_column='td_arima_partition_id',
residual_table_order_column='period',
partition_columns='td_arima_partition_id',
n_ahead=15)
# Print the result dataframe
print(arima_predict_out1.result)
# Example 2: Using coefficient table from a presisted Arima model
# generated by Arima function.Persist the model tables generated by
# Arima function.
copy_to_sql(arima_out.coefficient, table_name = "arima_coefficients")
copy_to_sql(arima_out.residual_table, table_name = "arima_residualtable")
# Create teradataml Dataframe object
arima_coefficients = DataFrame("arima_coefficients")
arima_residualtable = DataFrame("arima_residualtable")
# Find prediction.
arima_predict_out2 = ArimaPredict(object=arima_coefficients,
object_partition_column='td_arima_partition_id',
residual_table=arima_residualtable,
residual_table_partition_column='td_arima_partition_id',
residual_table_order_column='period',
partition_columns='td_arima_partition_id',
n_ahead=15)
# Print the result dataframe
print(arima_predict_out2.result)
- __repr__(self)
- Returns the string representation for a ArimaPredict class instance.
|