predict.LiblineaR
From LiblineaR v2.10-8
by Thibault Helleputte
Predictions with LiblineaR model
The function applies a model (classification or regression) produced by the LiblineaR
function to every row of a
data matrix and returns the model predictions.
- Keywords
- multivariate, classes, models, regression, classif, optimize
Usage
# S3 method for LiblineaR
predict(object, newx, proba = FALSE,
decisionValues = FALSE, ...)
Arguments
- object
- Object of class
"LiblineaR"
, created byLiblineaR
. - newx
- An n x p matrix containing the new input data. A vector will be transformed to a n x 1 matrix. A sparse matrix (from SparseM package) will also work.
- proba
- Logical indicating whether class probabilities should be
computed and returned. Only possible if the model was fitted with
type
=0,type
=6 ortype
=7, i.e. a Logistic Regression. Default isFALSE
. - decisionValues
- Logical indicating whether model decision values should
be computed and returned. Only possible for classification models
(
type
<10). Default isFALSE
. - ...
- Currently not used
Value
By default, the returned value is a list with a single entry:
proba
is set to TRUE
, and the model is a logistic
regression, an additional entry is returned:
decisionValues
is set to TRUE
, and the model is not a
regression model, an additional entry is returned:
Note
If the data on which the model has been fitted have been centered
and/or scaled, it is very important to apply the same process on the
newx
data as well, with the scale and center values of the training
data.
References
- For more information on 'LIBLINEAR' itself, refer to: R.-E. Fan, K.-W. Chang, C.-J. Hsieh, X.-R. Wang, and C.-J. Lin. LIBLINEAR: A Library for Large Linear Classification, Journal of Machine Learning Research 9(2008), 1871-1874. http://www.csie.ntu.edu.tw/~cjlin/liblinear
See Also
Community examples
Looks like there are no examples yet.