OutlierFilterTransform
Description
td_outlier_filter_transform_sqle()
function filters the outliers from the input tbl_teradata.
td_outlier_filter_transform_sqle()
uses the result tbl_teradata from
td_outlier_filter_fit_sqle()
function to get
statistics like median, count of rows, lower percentile and upper percentile for every column
specified in target columns argument and filters the outliers in the input data.
Usage
td_outlier_filter_transform_sqle (
data = NULL,
object = NULL,
...
)
Arguments
data |
Required Argument. |
object |
Required 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_outlier_filter_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_data <- tbl(con, "titanic")
# Check the list of available analytic functions.
display_analytic_functions()
# Example 1: Finding outliers in column "fare" using "PERCENTILE" method.
# Generate fit object for column "fare".
fit_obj <- td_outlier_filter_fit_sqle(
data=titanic_data,
target.columns="fare",
lower.percentile=0.1,
upper.percentile=0.9,
outlier.method="PERCENTILE",
replacement.value="MEDIAN",
percentile.method="PERCENTILECONT")
# Print the result.
print(fit_obj$result)
# Find the outliers by transforming fit object result tbl_teradata.
# Note that tbl_teradata representing the model is passed as
# input to "object".
obj <- td_outlier_filter_transform_sqle(data=titanic_data,
object=fit_obj$result)
# Print the result.
print(obj$result)
# Example 2: Find outliers in column "fare" using "PERCENTILE"
# method. Note that model is passed as instance of
# td_outlier_filter_fit_sqle to "object".
obj1 <- td_outlier_filter_transform_sqle(data=titanic_data,
object=fit_obj)
# Print the result.
print(obj1$result)
# Alternatively use S3 transform function to run transform on the output of
# td_outlier_filter_fit_sqle() function.
obj1 <- transform(fit_obj,
data=titanic_data)
# Print the result.
print(obj1$result)