NonLinearCombineTransform
Description
The td_non_linear_combine_transform_sqle()
function generates a new feature
by taking a non-linear combination of existing features using the
parameters from the output of td_non_linear_combine_fit_sqle()
function.
Usage
td_non_linear_combine_transform_sqle (
data = NULL,
object = NULL,
accumulate = NULL,
...
)
Arguments
data |
Required Argument. |
object |
Required Argument. |
accumulate |
Optional Argument. |
... |
Specifies the generic keyword arguments SQLE functions accept. Below
are the generic keyword arguments: volatile: Function allows the user to partition, hash, order or local order the input data. These generic arguments are available for each argument that accepts tbl_teradata as input and can be accessed as:
Note: |
Value
Function returns an object of class "td_non_linear_combine_transform_sqle"
which is a named list containing object of class "tbl_teradata".
Named list member(s) can be referenced directly with the "$" operator
using the name(s):result
Examples
# Get the current context/connection.
con <- td_get_context()$connection
# Load the example data.
loadExampleData("tdplyr_example", "titanic")
# Create tbl_teradata object.
titanic <- tbl(con, "titanic")
# Check the list of available analytic functions.
display_analytic_functions()
# Create model to obtain total cost for passenger using formula
# ('sibsp' + 'parch' + 1) * 'fare'.
Fit_out <- td_non_linear_combine_fit_sqle(
data = titanic,
target.columns = c("sibsp", "parch", "fare"),
formula = "Y=(X0+X1+1)*X2",
result.column = "total_cost")
# Example 1 : Get the total cost for each passenger.
NonLinearCombineTransform_out <- td_non_linear_combine_transform_sqle(
data=titanic,
object=Fit_out,
accumulate="passenger")
# Print the result.
print(NonLinearCombineTransform_out$result)
# Alternatively use S3 transform function to run transform on the output of
# td_non_linear_combine_fit_sqle() function.
# Example 1 : Get the total cost for each passenger.
NonLinearCombineTransform_out <- transform(Fit_out,
data=titanic,
accumulate="passenger")
# Print the result.
print(NonLinearCombineTransform_out$result)