Teradata R Package Function Reference - SVMDenseSummary - Teradata R Package - Look here for syntax, methods and examples for the functions included in the Teradata R Package.

Teradata® R Package Function Reference

Product
Teradata R Package
Release Number
16.20
Published
February 2020
Language
English (United States)
Last Update
2020-02-28
dita:id
B700-4007
lifecycle
previous
Product Category
Teradata Vantage

Description

The DenseSVMModelPrinter (td_svm_dense_summary_mle) function extracts readable information from the model produced by the DenseSVMTrainer (td_svm_dense_mle) function. The function can display either a summary of the model training results or a table containing the weights for each attribute.

Usage

  td_svm_dense_summary_mle (
      object = NULL,
      data = NULL,
      attribute.columns = NULL,
      summary = FALSE,
      data.sequence.column = NULL,
      object.sequence.column = NULL
  )

Arguments

object

Required Argument.
Specifies the model tbl_teradata object generated by td_svm_dense_mle trainer function.

data

Required Argument.
Specifies training dataset input table tibble object specified in "data" argument used to produce model by td_svm_dense_mle function, otherwise the result may be incomplete.

attribute.columns

Required Argument.
Specifies input table columns from "data" argument that contain the attributes of the test samples. Attribute columns must be numeric (int, real, bigint, smallint, or float).

summary

Optional Argument.
Specifies whether the function outputs only a summary of the model. If TRUE, the output contains only summary information of the model. If FALSE, the output contains the weight of each attribute in the model.
Default Value: FALSE

data.sequence.column

Optional Argument.
Specifies the vector of column(s) that uniquely identifies each row of the input argument "data". The argument is used to ensure deterministic results for functions which produce results that vary from run to run.

object.sequence.column

Optional Argument.
Specifies the vector of column(s) that uniquely identifies each row of the input argument "object". The argument is used to ensure deterministic results for functions which produce results that vary from run to run.

Value

Function returns an object of class "td_svm_dense_summary_mle" which is a named list containing Teradata tbl object.
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("svmdense_example", "svm_iris_train")
    
    # Create remote tibble objects.
    svm_iris_train <- tbl(con, "svm_iris_train")

    #Generate Radial Basis Model (RBF) Model
    densesvm_iris_rbf_model <- td_svm_dense_mle(data = svm_iris_train,
                                     sample.id.column = "id",
                                     attribute.columns = c('sepal_length', 'sepal_width' , 'petal_length' , 'petal_width'),
                                     kernel.function = "rbf",
                                     gamma = 0.1,
                                     subspace.dimension = 120,
                                     hash.bits = 512,
                                     label.column = "species",
                                     cost = 1,
                                     bias = 0,
                                     max.step = 100,
                                     seed = 1
                                     )
    
    #Example 1 - Display the model parameters (weights, attributes etc). 
    td_svm_dense_summary_out1 <- td_svm_dense_summary_mle(object = densesvm_iris_rbf_model,
                                                     data = svm_iris_train,
                                                     attribute.columns=c('sepal_length','sepal_width','petal_length','petal_width'),
                                                     summary = FALSE
                                                     )
    
    # Example 2 - outputs only summary of the model.
    td_svm_dense_summary_out2 <- td_svm_dense_summary_mle(object = densesvm_iris_rbf_model,
                                                     data = svm_iris_train,
                                                     attribute.columns=c('sepal_length','sepal_width','petal_length','petal_width'),
                                                     summary = TRUE
                                                     )