I write because I have a question concerning to prediction function. I have a PLSDA model defined by 5 chemical variables and I would predict the class of new samples. However, these samples have available only 4 chemical variables. I run the function with theses samples, and even if they have not all the variables they were classified (with a missing variable).
Do you know how the function can classify unknown samples with a missing variable? how it is possible?
With your example yes, I receive this error. I don’t know how provide you a reproductible example with my data, because I don’t know how upload my data to forum.
But, I think that difference between my example and the yours is that my database to be predicted is not completely incomplete.
I mean, for instance, of 20 samples (5 variables) 7 ones have not values of variable 4. Probably the algorithm deals the missing values? imputation?
I will try to provide you a reproductible example.
Another question:
Is it possible to save the plsda model (results)? I would like to avoid load database-create the model-select latent variables, etc and then predict. I would like just, to save plsda results and when I need, to load it and predict.