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

# S3 method for HGBTClassifier
score(
  model,
  data,
  key,
  features = NULL,
  label = NULL,
  thread.ratio = NULL,
  missing.replacement = NULL,
  ...
)

Format

S3 methods

Arguments

model

R6Class object
An "HGBTClassifier" object for scoring.

key

character
Specifies the ID column in data.

features

character or 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.

missing.replacement

character, optional
The missing replacement strategy:

  • "feature.marginalized": marginalize each missing feature out independently.

  • "instance.marginalized": marginalize all missing features in an instance as a whole corresponding to each category.

Defaults to "feature.marginalized".

...

Reserved parameters.

Value

numeric
The accuracy score of model applied to data.