ScaleTransform
Description
td_scale_transform_sqle()
function scales specified columns in input
data, using td_scale_fit_sqle()
function output.
Usage
td_scale_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. 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_scale_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("scalemap_example", "scale_housing")
# Create tbl_teradata.
scaling_house <- tbl(con, "scale_housing")
# Check the list of available analytic functions.
display_analytic_functions()
# Example 1: Scale "lotsize" with respect to mean value of the column.
fit_obj <- td_scale_fit_sqle(data=scaling_house,
target.columns="lotsize",
scale.method="MEAN",
miss.value="KEEP",
global.scale=FALSE,
multiplier="1",
intercept="0")
# Print the result.
print(fit_obj$result)
# Scale "lotsize" column.
# Note that tbl_teradata representing the model is passed as
# input to "object".
obj <- td_scale_transform_sqle(data=scaling_house,
object=fit_obj$result,
accumulate="price")
# Print the result.
print(obj$result)
# Example 2: Scale "lotsize" column. Note that model is passed as instance of
# td_scale_fit_sqle to "object".
obj1 <- td_scale_transform_sqle(data=scaling_house,
object=fit_obj,
accumulate="price")
# Print the result.
print(obj1$result)
# Alternatively use S3 transform function to run transform on the output of
# td_scale_fit_sqle() function.
obj1 <- transform(fit_obj,
data=scaling_house,
accumulate="price")
# Print the result.
print(obj1$result)