predict.GLM.Rd
Similar to other predict methods, this function predicts fitted values from a fitted "GLM" object.
# S3 method for GLM
predict(
model,
data,
key,
features = NULL,
prediction.type = NULL,
significance.level = NULL,
handle.missing = NULL
)
S3
methods
R6Class object
A "GLM" object for prediction.
DataFrame
DataFrame containting the data.
character
Name of the ID column.
character of list of characters, optional
Name of feature columns for prediction.
If not provided, it defaults to all non-key columns of data.
character, optional
Specifies whether to output predicted values of the
response or the link function.
Defaults to 'response'.
double, optional
Significance level for confidence intervals and prediction
intervals. If specified, overrides the value passed to the
GLM constructor.
c("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".
Dataframe Predicted values, structured as follows. The following two columns are always populated:
ID column, with same name and type as data's ID column.
PREDICTION, type NVARCHAR(100), representing predicted values.
The following five columns are only populated for IRLS:
SE, type DOUBLE. Standard error, or for ordinal regression, the probability that the data point belongs to the predicted category.
CI_LOWER, type DOUBLE. Lower bound of the confidence interval.
CI_UPPER, type DOUBLE. Upper bound of the confidence interval.
PI_LOWER, type DOUBLE. Lower bound of the prediction interval.
PI_UPPER, type DOUBLE. Upper bound of the prediction interval.
DataFrame data2 for prediction:
> data2$Collect()
ID X
1 1 -1
2 2 0
3 3 1
4 4 2
Call the function and obtain the result:
> predict(glm, data2, key="ID")$Collect()
ID PREDICTION
1 1 0.25543735346197155
2 2 0.744562646538029
3 3 2.1702915689746476
4 4 6.32608352871737