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

Make Predictions from a "Glm" Object

Description

Similar to other predict methods, this function predicts fitted values from a fitted "Glm" object.

Usage

## S3 method for class 'Glm'
predict(model, data, key, features = NULL,
  prediction.type = NULL, significance.level = NULL,
  handle.missing = NULL)

Arguments

model

R6Class object
Glm object for prediction.

data

DataFrame
data for prediction.

key

character
Name of the ID column.

features

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

prediction.type

character, optional
Specifies whether to output predicted values of the response or the link function.
Defaults to 'response'.

significance.level

double, optional
Significance level for confidence intervals and prediction intervals. If specified, overrides the value passed to the GLM constructor.

handle.missing

("remove", "fill_zero"), optional
How to handle data rows with missing independent variable values.

  • "remove" Remove missing rows.

  • "fill_zero" Replace missing values with 0.

Defaults to "remove".

Value

Dataframe Predicted values, structured as follows. The following two columns are always populated:

The following five columns are only populated for IRLS:

See Also

hanaml.Glm

Examples

## Not run: 
#'DataFrame df2 for prediction:
> df2.collect()
   ID  X
0   1 -1
1   2  0
2   3  1
3   4  2

Output:
>predict(glm, df2, key="ID")$collect()
   ID          PREDICTION
0   1  0.25543735346197155
1   2    0.744562646538029
2   3   2.1702915689746476
3   4     6.32608352871737

## End(Not run)

[Package hana.ml.r version 1.0.8 Index]