DecisionTreePredict
Description
The td_decision_tree_predict_mle_sqle()
function applies a tree model to a data
input, outputting predicted labels for each data point.
Usage
td_decision_tree_predict_mle_sqle (
object = NULL,
newdata = NULL,
attr.table.groupby.columns = NULL,
attr.table.pid.columns = NULL,
attr.table.val.column = NULL,
output.response.probdist = FALSE,
accumulate = NULL,
output.responses = NULL,
...
)
Arguments
object |
Required Argument. |
newdata |
Required Argument. |
attr.table.groupby.columns |
Required Argument. |
attr.table.pid.columns |
Required Argument. |
attr.table.val.column |
Required Argument. |
output.response.probdist |
Optional Argument. |
accumulate |
Optional Argument. |
output.responses |
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_decision_tree_predict_mle_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("decisiontreepredict_example", "iris_attribute_test", "iris_attribute_output")
# Create tbl_teradata object.
iris_attribute_test <- tbl(con, "iris_attribute_test")
# Check the list of available analytic functions.
display_analytic_functions()
# Example 1: First create tbl_teradata of trained Decision Tree Model and then
# perform prediction using "td_decision_tree_predict_mle_sqle()" function.
# Create tbl_teradata of trained Decision Tree Model.
td_decision_tree_out = tbl(con, "iris_attribute_output")
# Run predict on the trained decision tree model.
decision_tree_predict_out <- td_decision_tree_predict_mle_sqle(
newdata=iris_attribute_test,
newdata.partition.column='pid',
object=td_decision_tree_out,
attr.table.groupby.columns='attribute',
attr.table.pid.columns='pid',
attr.table.val.column='attrvalue',
accumulate='attribute')
# Print output.
print(decision_tree_predict_out$result)