SVMSparsePredict
Description
The td_svm_sparse_predict_mle_sqle()
function takes the model generated by the
td_svm_sparse_mle()
trainer function and a set of test samples (in sparse
format) and outputs a prediction for each sample.
Usage
td_svm_sparse_predict_mle_sqle (
object = NULL,
newdata = NULL,
sample.id.column = NULL,
attribute.column = NULL,
value.column = NULL,
accumulate.label = NULL,
output.class.num = 1,
output.prob = TRUE,
output.responses = NULL,
...
)
Arguments
object |
Required Argument. |
newdata |
Required Argument. |
sample.id.column |
Required Argument. |
attribute.column |
Required Argument. |
value.column |
Optional Argument. |
accumulate.label |
Optional Argument. |
output.class.num |
Optional Argument. |
output.prob |
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_svm_sparse_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 data to run the example.
loadExampleData("svmsparsepredict_example", "svm_iris_input_test", "svm_iris_model")
# Create tbl_teradata
svm_train <- tbl(con, "svm_iris_model")
svm_iris_input_test <- tbl(con, "svm_iris_input_test")
# Check the list of available analytic functions.
display_analytic_functions()
# Example 1: tbl_teradata containing the model data is passed as input
# to object argument.
svm_sparse_predict_result1 <- td_svm_sparse_predict_mle_sqle(
newdata=svm_iris_input_test,
object=svm_train,
attribute.column='attribute',
sample.id.column='id',
value.column='value1',
accumulate.label='species')
# Print the result.
print(svm_sparse_predict_result1$result)
# Example 2: Predict the species and display probability for "setosa" and "virginica".
svm_sparse_predict_result2 <- td_svm_sparse_predict_mle_sqle(
newdata=svm_iris_input_test,
object=svm_train,
attribute.column='attribute',
sample.id.column='id',
value.column='value1',
accumulate.label='species',
output.prob= TRUE,
output.responses= c('setosa', 'virginica'))
# Print the result.
print(svm_sparse_predict_result2$result)