OneHotEncodingFit
Description
Function records all the parameters required for td_one_hot_encoding_transform_sqle()
function.
Such as, target attributes and their categorical values to be encoded and other parameters.
Output of td_one_hot_encoding_fit_sqle()
function is used by td_one_hot_encoding_transform_sqle()
function for encoding the input data. It supports inputs in both sparse and dense format.
Usage
td_one_hot_encoding_fit_sqle (
data = NULL,
is.input.dense = NULL,
target.column = NULL,
categorical.values = NULL,
other.column = NULL,
attribute.column = NULL,
value.column = NULL,
target.attributes = NULL,
other.attributes = NULL,
...
)
Arguments
data |
Required Argument. |
is.input.dense |
Required Argument. |
target.column |
Required Argument when 'is_input_dense=TRUE', disallowed otherwise. |
categorical.values |
Required Argument when 'is_input_dense=TRUE', disallowed otherwise. |
other.column |
Required Argument when 'is_input_dense=TRUE', disallowed otherwise. |
attribute.column |
Required Argument when 'is_input_dense=FALSE', disallowed otherwise. |
value.column |
Required Argument when 'is_input_dense=FALSE', disallowed otherwise. |
target.attributes |
Required Argument when 'is_input_dense=FALSE', disallowed otherwise. |
other.attributes |
Optional Argument when 'is_input_dense=FALSE', disallowed otherwise. |
... |
Specifies the generic keyword arguments SQLE functions accept. 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_one_hot_encoding_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):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_data <- tbl(con, "titanic")
# Check the list of available analytic functions.
display_analytic_functions()
# Example 1: Generate fit object to encode "male" and "female" values of column "sex".
fit_obj <- td_one_hot_encoding_fit_sqle(data=titanic_data,
is.input.dense=TRUE,
target.column="sex",
categorical.values=c("male", "female"),
other.column="other")
# Print the result.
print(fit_obj$result)