Teradata Package for Python Function Reference - IDWT - Teradata Package for Python - Look here for syntax, methods and examples for the functions included in the Teradata Package for Python.

Teradata® Package for Python Function Reference

Product
Teradata Package for Python
Release Number
17.00
Published
November 2021
Language
English (United States)
Last Update
2021-11-19
lifecycle
previous
Product Category
Teradata Vantage

 
teradataml.analytics.mle.IDWT = class IDWT(builtins.object)
     Methods defined here:
__init__(self, coefficient=None, meta_table=None, input_columns=None, sort_column=None, partition_columns=None, coefficient_sequence_column=None, meta_table_sequence_column=None)
DESCRIPTION:
    The IDWT function is the inverse of DWT; that is, IDWT applies 
    inverse wavelet transforms on multiple sequences simultaneously.
    IDWT takes as input the output teradataml DataFrame and meta
    DataFrame output by DWT and outputs the sequences in time domain.
    (Because the IDWT output is comparable to the DWT input, the
    inverse transformation is also called the reconstruction.)
 
 
PARAMETERS:
    coefficient:
        Required Argument.
        Specifies the name of the input teradataml DataFrame that
        contains the coefficients generated by DWT. Typically, this
        teradataml DataFrame is the output teradataml DataFrame of
        DWT.
 
    meta_table:
        Required Argument.
        Specifies the name of the input teradataml DataFrame that
        contains the meta information used in DWT. Typically, this
        teradataml DataFrame is the meta teradataml DataFrame output
        by DWT.
 
    input_columns:
        Required Argument.
        Specifies the names of the columns, present in the 'coefficent'
        teradataml DataFrame, that contain the data to be transformed.
        These columns must contain numeric values between -1e308 and
        1e308. The function treats NULL in columns as 0.
        Types: str OR list of Strings (str)
 
    sort_column:
        Required Argument.
        Specifies the name of the input column that represents the
        order of coefficients in each sequence (the waveletid column
        in the DWT output teradataml DataFrame). The column must
        contain a sequence of integer values that start from 1 for
        each sequence. If a value is missing from the sequence, then
        the function treats the corresponding data column as 0.
        Types: str
 
    partition_columns:
        Optional Argument.
        Specifies the names of the partition_columns, which identify
        the sequences. Rows with the same partition_columns values
        belong to the same sequence. If you specify multiple
        partition_columns, then the function treats the first one as
        the distribute key of the output and meta teradataml DataFrames.
        By default, all rows belong to one sequence, and the function
        generates a distribute key column named 'dwt_idrandom_name' in
        both the output teradataml DataFrame and the meta teradataml
        DataFrame. In both teradataml DataFrames, every cell of
        'dwt_idrandom_name' has the value 1.
        Types: str OR list of Strings (str)
 
    coefficient_sequence_column:
        Optional Argument.
        Specifies the list of column(s) that uniquely identifies each
        row of the input argument "coefficient". 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)
 
    meta_table_sequence_column:
        Optional Argument.
        Specifies the list of column(s) that uniquely identifies each
        row of the input argument "meta_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 IDWT.
    Output teradataml DataFrames can be accessed using attribute
    references, such as IDWTObj.<attribute_name>.
    Output teradataml DataFrame attribute names are:
        1. output_table
        2. output
 
 
RAISES:
    TeradataMlException
 
 
EXAMPLES:
 
    # Load example data of "DWT".
    load_example_data("dwt", ["ville_climatedata", "dwt_filter_dim"])
 
    # The table "ville_climatedata" contains hourly climate data for five
    # cities on a given day. The table "dwt_filter_dim" contains wavelet
    # filter information.
 
    # Example 1 : Apply inverse wavelet transform on the output of
    #             DWT, to generate time series sequence.
 
    # Create teradataml DataFrame objects.
    ville_climatedata = DataFrame.from_table("ville_climatedata")
    dwt_filter_dim = DataFrame.from_table("dwt_filter_dim")
 
    DWT_out = DWT(data = ville_climatedata,
                    input_columns = ["temp_f","pressure_mbar","dewpoint_f"],
                    wavelet_filter=dwt_filter_dim,
                    sort_column = "period",
                    level = 2,
                    partition_columns = "city",
                    wavelet_filter_sequence_column="filtername"
                    )
 
    IDWT_out = IDWT(coefficient = DWT_out.coefficient,
                    meta_table = DWT_out.meta_table,
                    input_columns = ["temp_f","pressure_mbar","dewpoint_f"],
                    sort_column = "waveletid",
                    partition_columns = ["city"]
                    )
 
    # Print the results
    print(IDWT_out.output_table)
 
    # Example 2 : Alternatively, persist the outputs of DWT in
    #             Vantage and use persisted tables to perform IDWT.
 
    # Persisting DWT_out.coefficient to table named as 'dwt_coef_table'
    # and DWT_out.meta_table to table named as 'dwt_meta_table'.
    copy_to_sql(DWT_out.coefficient, "dwt_coef_table")
    copy_to_sql(DWT_out.meta_table, "dwt_meta_table")
 
    # Create teradataml DataFrame objects.
    dwt_coef_table = DataFrame.from_table("dwt_coef_table")
    dwt_meta_table = DataFrame.from_table("dwt_meta_table")
 
    IDWT_out = IDWT(coefficient = dwt_coef_table,
                    meta_table = dwt_meta_table,
                    input_columns = ["temp_f","pressure_mbar","dewpoint_f"],
                    sort_column = "waveletid",
                    partition_columns = ["city"]
                    )
 
    # Print the results
    print(IDWT_out)
__repr__(self)
Returns the string representation for a IDWT 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.