| |
- NonLinearCombineFit(data=None, target_columns=None, formula=None, result_column='TD_CombinedValue', **generic_arguments)
- DESCRIPTION:
The NonLinearCombineFit() function returns the target columns and a
specified formula which uses the non-linear combination of existing features.
Notes:
* This function requires the UTF8 client character set for UNICODE data.
* This function does not support Pass Through Characters (PTCs).
* For information about PTCs, see Teradata Vantage™ - Analytics Database
International Character Set Support.
* This function does not support KanjiSJIS or Graphic data types.
PARAMETERS:
data:
Required Argument.
Specifies the input teradataml DataFrame.
Types: teradataml DataFrame
target_columns:
Required Argument.
Specifies the name(s) of the column(s) in "data" to run the
non-linear combination.
Types: str OR list of Strings (str)
formula:
Required Argument.
Specifies the formula to be used for non-linear combination.
Types: str
result_column:
Optional Argument.
Specifies the name of the new feature column generated by the Transform function.
This function saves the specified formula in this column.
Default Value: 'TD_CombinedValue'
Types: str
**generic_arguments:
Specifies the generic keyword arguments SQLE functions accept. Below
are the generic keyword arguments:
persist:
Optional Argument.
Specifies whether to persist the results of the
function in a table or not. When set to True,
results are persisted in a table; otherwise,
results are garbage collected at the end of the
session.
Default Value: False
Types: bool
volatile:
Optional Argument.
Specifies whether to put the results of the
function in a volatile table or not. When set to
True, results are stored in a volatile table,
otherwise not.
Default Value: False
Types: bool
Function allows the user to partition, hash, order or local
order the input data. These generic arguments are available
for each argument that accepts teradataml DataFrame as
input and can be accessed as:
* "<input_data_arg_name>_partition_column" accepts str or
list of str (Strings)
* "<input_data_arg_name>_hash_column" accepts str or list
of str (Strings)
* "<input_data_arg_name>_order_column" accepts str or list
of str (Strings)
* "local_order_<input_data_arg_name>" accepts boolean
Note:
These generic arguments are supported by teradataml if
the underlying SQL Engine function supports, else an
exception is raised.
RETURNS:
Instance of NonLinearCombineFit.
Output teradataml DataFrames can be accessed using attribute
references, such as NonLinearCombineFitObj.<attribute_name>.
Output teradataml DataFrame attribute names are:
1. result
2. output_data
RAISES:
TeradataMlException, TypeError, ValueError
EXAMPLES:
# Notes:
# 1. Get the connection to Vantage to execute the function.
# 2. One must import the required functions mentioned in
# the example from teradataml.
# 3. Function will raise error if not supported on the Vantage
# user is connected to.
# Load the example data.
load_example_data("teradataml", "titanic")
# Create teradataml DataFrame objects.
titanic = DataFrame.from_table("titanic")
# Check the list of available analytic functions.
display_analytic_functions()
# Example 1 : Create model to obtain total cost for passenger
# using formula ('sibsp' + 'parch' + 1) * 'fare'.
NonLinearCombineFit_out = NonLinearCombineFit(data = titanic,
target_columns = ["sibsp", "parch", "fare"],
formula = "Y=(X0+X1+1)*X2",
result_column = "total_cost")
# Print the result DataFrames.
print(NonLinearCombineFit_out.result)
print(NonLinearCombineFit_out.output_data)
|