This function predicts class labels of labeled dataset from a fitted "LogisticRegression" object, and return the corresponding accuracy score.

# S3 method for LogisticRegression
score(
  model,
  data,
  key,
  features = NULL,
  label = NULL,
  thread.ratio = NULL,
  multi.class = NULL,
  class.map0 = NULL,
  class.map1 = NULL,
  categorical.variable = NULL,
  ...
)

Format

S3 methods

Arguments

model

R6Class object
A "LogisticRegression" object for scoring.

key

character
Specifies the ID column in data.

features

character or a list of characters, optional
Specifies the feature columns in data.
The specified features must be the same as those in the model training phase.
Defaults to all non-key, non-label columns in data if not provided.

label

character, optional
Specifies the label column in data.
If not provided, defaults to the last non-key column in data.

thread.ratio

numeric, optional
Specified the number of threads used in model prediction.
The value range is from 0 to 1, where 0 indicates a single thread, and 1 indicates all available threads. Values between 0 and 1 will use up to that percentage of available threads.
Values outside the range from 0 to 1 are ignored, and the actual number of threads used is then be heuristically determined.
Defaults to -1. #@param multi.class logical, optional
If the value is TRUE, prediction for multi-class classification is performed.
Otherwise prediction for binary classification is performed.
Defaults to model$multi.class.

class.map0

character, optional
Categorical label to map to 0.
Only valid when multi.class or model$multi.class is FALSE. class.map0 is mandatory when label column type is VARCHAR or NVARCHAR for binary classification.
Defaults to model$class.map0.

class.map1

character, optional
Categorical label to map to 1.
Only valid when multi.class or model$multi.class is FALSE. class.map1 is mandatory when label column type is VARCHAR or NVARCHAR for binary classification.
Defaults to model$class.map1.

categorical.variable

character or list/vector of characters, optional
Indicates features should be treated as categorical variable.
The default behavior is dependent on what input is given:

  • "VARCHAR" and "NVARCHAR": categorical

  • "INTEGER" and "DOUBLE": continuous.

VALID only for variables of "INTEGER" type, omitted otherwise.
No default value.

Value

numeric
The accuracy score of model applied to data.