A prediction method for gpls.
A simple prediction method for
"predict"(object, newdata, ...)
gplsobject, typically obtained from a call to
- New data, for which predictions are desired.
- Other arguments to be passed on
The prediction method is straight forward. The estimated coefficients
object are used, together with the new data to produce
predicted values. These are then split, according to whether the
predicted values is larger or smaller than 0.5 and predictions
The code is similar to that in
except that in that function both the test and train matrices are
centered and scaled (the covariates) by the same values (those from
the test data set).
- The predicted classes; one for each row of
- The estimated predictors.
listof length two:
example(gpls) p1 = predict(m1)