BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SASdevAnneMarie
Rhodochrosite | Level 12

Hello Experts,

 

When applying the PLS procedure, is there an option to save the trained model for application to the test set?

 

Thank you !

1 ACCEPTED SOLUTION

Accepted Solutions
SASdevAnneMarie
Rhodochrosite | Level 12

I found the answer to my question here:

SASdevAnneMarie_0-1778955225158.png

 

View solution in original post

7 REPLIES 7
PaigeMiller
Diamond | Level 26

@Rick_SAS gives the explanation of how to predict a test data set here: https://blogs.sas.com/content/iml/2014/02/17/the-missing-value-trick-for-scoring-a-regression-model....

--
Paige Miller
SASdevAnneMarie
Rhodochrosite | Level 12
Thank you, but precisely, in Proc PLS we cannot use the train and test sets together in Proc.
PaigeMiller
Diamond | Level 26

@Ksharp links to my exact solution for this problem. You would use the test data set in PROC SCORE, rather than the training data set, as I did in that example. PROC SCORE gives the predicted values using the PLS model. The final step where I create data set named COMPARE is not needed for the case where you want to score a test data set. The model is stored in data set COEFFS and COEFFS_T.

--
Paige Miller
PaigeMiller
Diamond | Level 26

@SASdevAnneMarie wrote:
Thank you, but precisely, in Proc PLS we cannot use the train and test sets together in Proc.

Yes, you can use the test and train data set together, in certain situations. Obviously you are not in that situation.

--
Paige Miller
Ksharp
Super User
https://communities.sas.com/t5/Statistical-Procedures/score-for-PLS-procedure-issue/m-p/676606


The only thing you need to do is using SOLUTION option to save parameters estimator and score test data as PROC GLM .
SASdevAnneMarie
Rhodochrosite | Level 12

I found the answer to my question here:

SASdevAnneMarie_0-1778955225158.png

 

PaigeMiller
Diamond | Level 26

This is the same thing I linked to in my original post, which you said was wrong, you said you can't use the training data set and test data set in the same PROC PLS.

--
Paige Miller

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 187 views
  • 0 likes
  • 3 in conversation