predict.HGBTClassifier {hana.ml.r}R Documentation

Predict using HGBTClassifier

Description

Predict using the HGBTClassifier model.

Usage

## S3 method for class 'HGBTClassifier'
predict(model, data, key, features = NULL,
  verbose = NULL, thread.ratio = NULL, missing.replacement = NULL)

Arguments

model

R6Class
HGBTClassifier object.

data

DataFrame
DataFrame containing the data.

key

character
Name of the ID column.

features

character or list of characters, optional
Names of the feature columns. If not provided, it defaults to all the non-ID columns.

verbose

logical, optional
If TRUE, output all classes and the corresponding confidences for each data point.
This parameter is valid only for classification.
Defaults to FALSE.

thread.ratio

double, optional
The ratio of available threads used for training.
- 0: single thread;
- (0,1): percentage of available threads;
- others : heuristically determined.
Defaults to -1.

missing.replacement

character, optional
The missing replacement strategy:

  • feature_marginalized: marginalise each missing feature out independently.

  • instance_marginalized: marginalise all missing features in an instance as a whole corr

Value

Dataframe
Prediction result, structured as follows:

See Also

hanaml.HGBTClassifier

Examples

## Not run: 
Performing predict() on given DataFrame:

> df_predict$Collect()
 ID  ATT1  ATT2   ATT3  ATT4
 1   1.0   10.0   100   1
 2   1.1   10.1   100   1
 3   1.2   10.2   100   1
 4   1.3   10.4   100   1
 5   1.2   10.3   100   3
 6   4.0   40.0   400   3
 7   4.1   40.1   400   3
 8   4.2   40.2   400   3
 9   4.3   40.4   400   3
10   4.2   40.3   400   3

> result <- predict.HGBTClassifier(ghc, df_predict, key = 'ID', verbose = FALSE)
or
> result <- predict(ghc, df_predict, key = 'ID', verbose = FALSE)
> result$Collect()
    ID SCORE  CONFIDENCE
0   1     A    0.852674
1   2     A    0.852674
2   3     A    0.852674
3   4     A    0.852674
4   5     A    0.751394
5   6     B    0.703119
6   7     B    0.703119
7   8     B    0.703119
8   9     B    0.830549
9  10     B    0.703119

## End(Not run)

[Package hana.ml.r version 1.0.8 Index]