predict_opls.Rd
Calculation of OPLS model predictions using new data
predict_opls(opls_model, newdata, idx_scale = NULL)
opls_model | OPLS model (regression of discriminant analysis) of class |
---|---|
newdata | NMR data matrix or dataframe with rows representing spectra and identical features in columns as data matrix used to calculate original OPLS model. |
idx_scale | int vector, row-indices of newdata used to subselect samples to determine scale and center pars. Recommded: set to NULL: use center and scaling parameters from opsl training data |
Returned is a list with the following elements:
Class or numeric outcome predictions for discriminant analysis or regression, repspectively.
Predicted OPLS model scores for predictive component(s).
Predicted OPLS model scores for orthogonal component(s).
Scores of a PCA model (first component) calculated using all predicted OPLS orthogonal component scores - only done when there are more than one orthogonal components in opls_model
.
Class predictions for discriminant analysis are not adjusted for unbalanced sample sizes and therefore, predictions can be biased towards the group with the largest number of samples. The list element t_orth_pca
represent scores of the first principal component of a PCA model caclulated with all orthogonal components, therefore, summarises all orthogonal components into a single one. This can only be done if there are more than one orthogonal components in opls_modelel
, otherwise this list element is NULL
.
Trygg J. and Wold, S. (2002) Orthogonal projections to latent structures (O-PLS). Journal of Chemometrics, 16.3, 119-128.
Geladi, P and Kowalski, B.R. (1986), Partial least squares and regression: a tutorial. Analytica Chimica Acta, 185, 1-17.
Other NMR ++:
.hotellingsT2()
,
cvanova()
,
es_cdelta()
,
minmax()
,
opls_perm()
,
pca()
,
plotscores()
,
pqn()
,
scRange()
torben.kimhofer@murdoch.edu.au
#>#> Error in .checkDimXY(X, y_check[[1]]): Error: Dimensions of input X and Y do not match.preds=predict_opls(model, X)#> Error in is(opls_model): object 'model' not found#> Error in table(preds$Y_predicted, an$type): object 'preds' not found