| |
Methods defined here:
- __init__(self, meta_table=None, coefficient=None, input_columns=None, sort_column=None, compact_output=True, partition_columns=None, coefficient_sequence_column=None, meta_table_sequence_column=None)
- DESCRIPTION:
The IDWT2D function is the inverse of DWT2D, i.e., IDWT2D
applies inverse wavelet transforms on multiple sequences
simultaneously. IDWT2D takes as input the output teradataml
DataFrame and meta teradataml DataFrame generated by DWT2D and
outputs the sequences as 2-dimensional matrices. (Because the
IDWT2D output is comparable to the DWT2D input, the inverse
transformation is also called the reconstruction.)
PARAMETERS:
meta_table:
Required Argument.
Specifies the name of the input teradataml DataFrame that
contains the meta information used in DWT2D. Typically, this
teradataml DataFrame is the meta teradataml DataFrame output
by DWT2D.
coefficient:
Required Argument.
Specifies the name of the input teradataml DataFrame that
contains the coefficients generated by DWT2D. Typically, this
teradataml DataFrame is the coefficient teradataml DataFrame
output of DWT2D.
input_columns:
Required Argument.
Specifies the names of the columns, present in the
"coefficient", 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 "coefficient"). 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
compact_output:
Optional Argument.
Specifies whether to ignore (not output) rows in which all
coefficient values are very small (having an absolute value
less than 1e-12). For a sparse input matrix, ignoring such rows
reduces the output teradataml DataFrame size.
Default Value: True
Types: bool
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 IDWT2D.
Output teradataml DataFrames can be accessed using attribute
references, such as IDWT2DObj.<attribute_name>.
Output teradataml DataFrame attribute names are:
1. output_table
2. output
RAISES:
TeradataMlException
EXAMPLES:
# Load example data of "DWT2D".
load_example_data("dwt2d", ["twod_climate_data"])
# This example uses climate data in many cities represented by
# two-dimensional coordinates (latitude and longitude), in the
# states of California (CA), Texas (TX), and Washington (WA).
# Example 1 : Apply inverse wavelet transform on the output of
# DWT2D, to generate 2-dimensional matrices.
# Create teradataml DataFrame objects.
twod_climate_data = DataFrame.from_table("twod_climate_data")
DWT2D_out = DWT2D(data = twod_climate_data,
input_columns = ["temp_f","pressure_mbar","dewpoint_f"],
index_columns = ["latitude","longitude"],
wavelet = "db2",
level = 2,
compact_output = True,
partition_columns = ["state"]
)
IDWT2D_out = IDWT2D(meta_table = DWT2D_out.meta_table,
coefficient = DWT2D_out.coefficient,
input_columns = ["temp_f","pressure_mbar","dewpoint_f"],
sort_column = "waveletid",
partition_columns = ["state"],
compact_output = False
)
# Print the results
print(IDWT2D_out.output_table)
# Example 2 : Alternatively, persist the outputs of DWT2D in
# Vantage and use persisted tables to perform IDWT2D.
# Persisting DWT2D_out.coefficient to table named as 'dwt2d_coeftable'
# and DWT2D_out.meta_table to table named as 'dwt2d_metatable'.
copy_to_sql(DWT2D_out.coefficient, "dwt2d_coeftable")
copy_to_sql(DWT2D_out.meta_table, "dwt2d_metatable")
# Create teradataml DataFrame objects.
dwt2d_coeftable = DataFrame.from_table("dwt2d_coeftable")
dwt2d_metatable = DataFrame.from_table("dwt2d_metatable")
IDWT2D_out = IDWT2D(meta_table = dwt2d_metatable,
coefficient = dwt2d_coeftable,
input_columns = ["temp_f","pressure_mbar","dewpoint_f"],
sort_column = "waveletid",
partition_columns = ["state"]
)
# Print the results
print(IDWT2D_out)
- __repr__(self)
- Returns the string representation for a IDWT2D 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.
|