[R] recovering PLSDA equations for prediction (outside R)
Diego Ruiz Moreno
diego at caseonit.com
Wed Dec 28 17:07:10 CET 2016
Hi all,
I'm trying to use the result of a PLSDA model outside R, but I'm having a
really hard time finding documentation on how to write the model from the
results in the fit object.
In order to provide a good starting point I believe that this code creates
a good model that is stored in the fit variable. I know that I can use the
predict function to create the predictions but I would like to "write the
predict function outside R".
Can anyone provide me with the equations? Thanks
# load the package
library(caret)
data(iris)
x <- iris[,1:4]
y <- iris[,5]
# fit model
fit <- plsda(x, y, probMethod="Bayes")
# summarize the fit
summary(fit)
# make predictions
predictions <- predict(fit, iris[,1:4])
# summarize accuracy
table(predictions, iris$Species)
[[alternative HTML version deleted]]
More information about the R-help
mailing list