NaiveBayesPredict
Description
td_naivebayes_predict_mle_sqle()
function predicts the outcomes for a test set of data
using the model output generated by the td_naivebayes_mle()
function.
Usage
td_naivebayes_predict_mle_sqle (
modeldata = NULL,
newdata = NULL,
id.col = NULL,
responses = NULL,
formula = NULL,
...
)
Arguments
modeldata |
Required Argument. |
newdata |
Required Argument. |
id.col |
Required Argument. |
responses |
Required Argument. |
formula |
Optional Argument. |
... |
Specifies the generic keyword arguments which 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_naivebayes_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
# Load example data.
loadExampleData("naivebayes_predict_example", "nb_iris_input_train","nb_iris_input_test")
# Create object(s) of class "tbl_teradata".
nb_iris_input_train <- tbl(con, "nb_iris_input_train")
nb_iris_input_test <- tbl(con, "nb_iris_input_test")
# Example 1 -
# Run the train function.
naivebayes_train <- td_naivebayes_mle(formula = (species ~ petal_length + sepal_width +
petal_width + sepal_length),
data = nb_iris_input_train)
# Generate prediction using output of train function.
naivebayes_predict_result1 <- td_naivebayes_predict_mle_sqle(newdata=nb_iris_input_test,
formula = (species ~ petal_length + sepal_width + petal_width +
sepal_length),
modeldata = naivebayes_train,
id.col = "id",
responses = c("virginica","setosa","versicolor")
)
# Print the result.
print(naivebayes_predict_result1$result)