predict.LiblineaR | R Documentation |
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.
## S3 method for class 'LiblineaR'
predict(object, newx, proba = FALSE, decisionValues = FALSE, ...)
object |
Object of class |
newx |
An n x p matrix containing the new input data. A vector will be transformed to a n x 1 matrix. Sparse matrices of class matrix.csr, matrix.csc and matrix.coo from package SparseM are accepted. Sparse matrices of class dgCMatrix, dgRMatrix or dgTMatrix from package Matrix are also accepted. Note that C code at the core of LiblineaR package corresponds to a row-based sparse format. Hence, dgCMatrix, dgTMatrix, matrix.csc and matrix.csr inputs are first transformed into matrix.csr or dgRMatrix formats, which requires small extra computation time. |
proba |
Logical indicating whether class probabilities should be
computed and returned. Only possible if the model was fitted with
|
decisionValues |
Logical indicating whether model decision values should
be computed and returned. Only possible for classification models
( |
... |
Currently not used |
By default, the returned value is a list with a single entry:
predictions |
A vector of predicted labels (or values for regression). |
If proba
is set to TRUE
, and the model is a logistic
regression, an additional entry is returned:
probabilities |
An n x k matrix (k number of classes) of the class probabilities. The columns of this matrix are named after class labels. |
If decisionValues
is set to TRUE
, and the model is not a
regression model, an additional entry is returned:
decisionValues |
An n x k matrix (k number of classes) of the model decision values. The columns of this matrix are named after class labels. |
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.
Thibault Helleputte thibault.helleputte@dnalytics.com and
Jerome Paul jerome.paul@dnalytics.com and Pierre Gramme.
Based on C/C++-code by Chih-Chung Chang and Chih-Jen Lin
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.
https://www.csie.ntu.edu.tw/~cjlin/liblinear/
LiblineaR
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.