PolynomialFeaturesFit
Description
td_polynomial_features_fit_sqle()
function stores all the specified values in the argument in a tbl_teradata format.
All polynomial combinations of the features with degrees less than or equal to the specified degree are
generated. For example, for a two-dimensional input sample [x, y], the degree-2 polynomial features are
[x, y, x-squared, xy, y-squared, 1].
Usage
td_polynomial_features_fit_sqle (
data = NULL,
target.columns = NULL,
include.bias = TRUE,
interaction.only = FALSE,
degree = 2,
...
)
Arguments
data |
Required Argument. |
target.columns |
Required Argument. |
include.bias |
Optional Argument. |
interaction.only |
Optional Argument. |
degree |
Optional Argument. |
... |
Specifies the generic keyword arguments SQLE functions accept. persist: 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_polynomial_features_fit_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):
output.data
result
Examples
# Get the current context/connection.
con <- td_get_context()$connection
# Load the example data.
loadExampleData("tdplyr_example", "numerics")
# Create tbl_teradata object.
numerics <- tbl(con, "numerics")
# Check the list of available analytic functions.
display_analytic_functions()
# Example 1: Create fit object to create polynomial features for columns
# "integer_col" and "smallint_col".
fit_obj <- td_polynomial_features_fit_sqle(data=numerics,
target.columns=c("integer_col", "smallint_col"),
degree=2)
# Print the result.
print(fit_obj$result)
print(fit_obj$output.data)