Similar to other predict methods, this function
predicts fitted values from a fitted "LogisticRegression" object.
# S3 method for LogisticRegression
predict(
model,
key,
data,
features = NULL,
verbose = FALSE,
thread.ratio = NULL,
multi.class = NULL,
class.map0 = NULL,
class.map1 = NULL,
categorical.variable = NULL
)
Arguments
| model |
R6Class object
A "LogisticRegression" object for prediction.
|
| key |
character
Name of the ID column.
|
| data |
DataFrame
DataFrame containting the data.
|
| features |
character of list of characters, optional
Name of feature columns for prediction.
If not provided, it defaults to all non-key columns of data.
|
| verbose |
logical, optional
If TRUE, output all classes and the corresponding
confidences for each data point.
Defaults to FALSE.
|
| thread.ratio |
double, optional
Controls the proportion of available threads that can be used by this
function.
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 this
range are ignored.
Defaults to 0.
|
| multi.class |
logical, optional
If the value is TRUE, prediction for multi-class classification is performed.
Otherwise prediction for binary classification is performed.
Defaults to model$multi.class.
|
| class.map0 |
character, optional
Categorical label to map to 0.
Only valid when multi.class or model$multi.class is FALSE.
class.map0 is mandatory when label column type is VARCHAR or
NVARCHAR during binary class fit and score.
Defaults to model$class.map0.
|
| class.map1 |
character, optional
Categorical label to map to 1.
Only valid when multi.class or model$multi.class is FALSE.
class.map1 is mandatory when label column type is VARCHAR or
NVARCHAR during binary class fit and score.
Defaults to model$class.map1.
|
| categorical.variable |
character or list/vector of characters, optional
Indicates features should be treated as categorical variable.
The default behavior is dependent on what input is given:
VALID only for variables of "INTEGER" type, omitted otherwise.
No default value. |
S3 methods
Value
Returns a Dataframe
containing predicted values, structured as follows.
ID column, with same name and type as `data`'s ID column.
CLASS, type NVARCHAR, predicted class name.
PROBABILITY, type DOUBLE.
Note
predict() will pass the pmml table to PAL as the model
representation if there is a pmml table, or the coefficients
table otherwise.
Examples
lr is a "LogisticRegression" object.
Call the function:
> predict(lr, data2, key = "ID", features = list("V1", "V2", "V3"))
See also