RandomProjectionTransform
Description
The td_random_projection_transform_sqle()
function converts the
high-dimensional input data to a low-dimensional space
using the td_random_projection_fit_sqle()
function output.
Usage
td_random_projection_transform_sqle (
object = NULL,
data = NULL,
accumulate = NULL,
...
)
Arguments
object |
Required Argument. |
data |
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_random_projection_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", "stock_movement")
# Create tbl_teradata object.
stock_movement <- tbl(con, "stock_movement")
# Check the list of available analytic functions.
display_analytic_functions()
# Example 1 : Get random projection matrix for
# stock_movement tbl_teradata.
fit_obj <- td_random_projection_fit_sqle(data=stock_movement,
target.columns="1:",
epsilon=0.9,
num.components=343)
# Generate feature matrix. Note that tbl_teradata representing
# the model is passed as input to "object".
RandomProjectionTransform_out <- td_random_projection_transform_sqle(
data=stock_movement,
object=fit_obj$result,
)
# Print the result.
print(RandomProjectionTransform_out$result)
# Example 2 : Generate feature matrix. Note that model is passed as instance of
# td_random_projection_fit_sqle to "object".
RandomProjectionTransform_out1 <- td_random_projection_transform_sqle(
data=stock_movement,
object=fit_obj,
)
# Print the result.
print(RandomProjectionTransform_out1$result)
# Alternatively use S3 transform function to run transform on the output of
# td_random_projection_fit_sqle() function.
obj1 <- transform(fit_obj,
data=stock_movement)
# Print the result.
print(obj1$result)