| |
Methods defined here:
- __init__(self, data=None, target_columns=None, data_sequence_column=None, data_partition_column=None, data_order_column=None)
- DESCRIPTION:
The CumulativeMovAvg function computes the cumulative moving average of a value
from the beginning of a series.
PARAMETERS:
data:
Required Argument.
Specifies the name of the teradataml DataFrame that contains the
columns.
data_partition_column:
Required Argument.
Specifies Partition By columns for data.
Values to this argument can be provided as list, if multiple columns
are used for partition.
Types: str OR list of Strings (str)
data_order_column:
Required Argument.
Specifies Order By columns for data.
Values to this argument can be provided as list, if multiple columns
are used for ordering.
Types: str OR list of Strings (str)
target_columns:
Optional Argument.
Specifies the input column names for which the moving average is to
be computed. If you omit this argument, then the function copies
every input column to the output teradataml DataFrame but does not
compute moving average.
Types: str OR list of Strings (str)
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)
RETURNS:
Instance of CumulativeMovAvg.
Output teradataml DataFrames can be accessed using attribute
references, such as CumulativeMovAvgObj.<attribute_name>.
Output teradataml DataFrame attribute name is:
result
RAISES:
TeradataMlException
EXAMPLES:
# Load Example Data
load_example_data("movavg", "ibm_stock")
# Create teradataml DataFrame objects.
ibm_stock = DataFrame.from_table("ibm_stock")
# Compute the cumulative moving average for "stockprice".
CumulativeMovAvg_out = CumulativeMovAvg(data = ibm_stock,
data_partition_column = ["name"],
data_order_column = ["period"],
target_columns = ["stockprice"]
)
# Print the results
print(CumulativeMovAvg_out)
- __repr__(self)
- Returns the string representation for a CumulativeMovAvg 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.
|