score a data.frame MASmodule/model

masScore(
  session,
  module,
  data,
  exact = TRUE,
  ScoreType = "score",
  forceTrail = TRUE,
  ...
)

Arguments

session

viya_connection object, obtained through session function

module

MASmodule object, module name. If name, will try to find a single module with exact name match. See exact parameter

data

data.frame data.frame of the data

exact

the filter query should use "contains" for partial match or "eq" for exact match

ScoreType

execute for decision, score for model

forceTrail

boolean, if the mas model is a decision (execute), it will force add a trailing underscore (_) in variable names.

...

additional parameters to be passed to httr::GET such as httr::add_headers

Value

data.frame with scored rows

Examples


if (FALSE) { # \dontrun{
# single row
scored <- masScore(sess, "module_name", data[1,])
scored

# The masScore is implemented with `furrr` for maximum performance
# if you want to parallelize use the following code. 
# Not recommended when scoring single row because overhead will drop the performance

future::plan(future::multisession, workers = future::availableCores() -1)
scored <- masScore(sess, "module_name", data)

# if you want to go back to single threaded scoring use
future::plan(future::sequential)
} # }