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

Predict using HGBTRegressor

Description

Predict using the HGBTRegressor model.

Usage

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

Arguments

model

R6Class object
Model output from HGBTRegressor

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

bool, 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
DataFrame containing the prediction result, structured as follows:

See Also

hanaml.HGBTRegressor

Examples

## Not run: 
  The trained model can be used for prediction.
  Input data for prediction, i.e. with missing target values.

  > df_predict$Collect()
     ID   ATT1     ATT2    ATT3    ATT4
  0   1  19.76   6235.0  100.00  100.00
  1   2  17.85  46230.0   43.67   84.53
  2   3  19.96   7360.0   65.51   81.57
  3   4  16.80  28715.0   45.16   93.33
  4   5  18.20  21934.0   49.20   83.07
  5   6  16.71   1337.0   74.84   94.99
  6   7  18.81  17881.0   70.66   92.34
  7   8  20.74   2319.0   63.93   95.08
  8   9  16.56  18040.0   14.45   61.24
  9  10  18.55   1147.0   68.58   97.90

  Predict the target values and view the results

  > result <- predict(hgr, df_predict, key = 'ID', verbose = FALSE)
  > result$Collect()
      ID       SCORE            CONFIDENCE
  0   1   23.79109147050638       None
  1   2   19.09572889593064       None
  2   3   21.56501359501561       None
  3   4  18.622664075787082       None
  4   5   19.05159916592106       None
  5   6  18.815530665858763       None
  6   7  19.761714911364443       None
  7   8   23.79109147050638       None
  8   9   17.84416828725911       None
  9  10  19.915574945518465       None

## End(Not run)


[Package hana.ml.r version 1.0.8 Index]