Description
The SVMSparsePredict function takes the model output by the function
SVMSparse (td_svm_sparse_mle
) and a set of test samples (in sparse format)
and outputs a prediction for each sample.
Note: This function is only available when tdplyr is connected to Vantage 1.1
or later versions.
Usage
td_svm_sparse_predict_mle (
object = NULL,
newdata = NULL,
sample.id.column = NULL,
attribute.column = NULL,
value.column = NULL,
accumulate.label = NULL,
output.class.num = NULL,
output.response.probdist = TRUE,
output.responses = NULL,
newdata.sequence.column = NULL,
object.sequence.column = NULL,
newdata.partition.column = NULL,
newdata.order.column = NULL,
object.order.column = NULL
)
Arguments
object |
Required Argument. |
object.order.column |
Optional Argument. |
newdata |
Required Argument. |
newdata.partition.column |
Required Argument. |
newdata.order.column |
Optional Argument. |
sample.id.column |
Required Argument. |
attribute.column |
Required Argument. |
value.column |
Optional Argument. |
accumulate.label |
Optional Argument. |
output.class.num |
Optional Argument.
Types: integer |
output.response.probdist |
Optional Argument. |
output.responses |
Optional Argument.
Types: character OR vector of characters |
newdata.sequence.column |
Optional Argument. |
object.sequence.column |
Optional Argument. |
Value
Function returns an object of class "td_svm_sparse_predict_mle" which
is a named list containing object of class "tbl_teradata".
Named list member can be referenced directly with the "$" operator
using name: result.
Examples
# Get the current context/connection
con <- td_get_context()$connection
# Load example data.
loadExampleData("svmsparsepredict_example", "svm_iris_input_test", "svm_iris_input_train")
# Create object(s) of class "tbl_teradata".
svm_iris_input_train <- tbl(con, "svm_iris_input_train")
svm_iris_input_test <- tbl(con, "svm_iris_input_test")
# Example 1 -
# Generate SparseSVMTrainer model based on train data "svm_iris_input_train".
svm_iris_model <- td_svm_sparse_mle(data = svm_iris_input_train,
sample.id.column = "id",
attribute.column = "attribute",
value.column = "value1",
label.column = "species",
max.step = 150,
seed = 0
)
# Use the generated model to predict the 'species' on the test data "svm_iris_input_test".
td_svm_sparse_predict_mle_out <- td_svm_sparse_predict_mle(object = svm_iris_model,
newdata = svm_iris_input_test,
newdata.partition.column = c("id"),
attribute.column = "attribute",
sample.id.column = "id",
value.column = "value1",
accumulate.label = "species"
)