The fPcaScore action performs scoring for functional principal component analysis (FPCA). It uses an analytic store (astore) model created by the FPCA training action to project new functional data onto the principal components. This action is essential for dimensionality reduction and feature extraction in functional data analysis workflows.
| Parameter | Description |
|---|---|
| table | Specifies the input table containing the functional data to be scored. Required. |
| model | Specifies the table containing the analytic store (model) from the training phase. Required. |
| output | Specifies the output table options. Contains sub-parameters like 'casout' and 'npc'. |
| casout | Sub-parameter of 'output'. Specifies the name and options for the output CAS table containing the scores. |
| npc | Sub-parameter of 'output'. Specifies the number of principal components to use in scoring. Default is 4. |
| id | Specifies the variable(s) used as record identifiers for the functional curves. |
| inputs | Specifies the variables to be used in the analysis. |
| display | Specifies which results tables to send to the client for display. |
Create a CAS table with functional data for scoring. Note: This example assumes an FPCA model table named 'fpca_model' already exists.
| 1 | |
| 2 | DATA casuser.score_data; |
| 3 | DO id=1 to 50; |
| 4 | DO time=1 to 20; |
| 5 | value=sin(time/5) + rannor(1)*0.1; |
| 6 | OUTPUT; |
| 7 | END; |
| 8 | END; |
| 9 | |
| 10 | RUN; |
| 11 |
Score the input data using the trained model and save results.
| 1 | |
| 2 | PROC CAS; |
| 3 | fpca.fPcaScore / TABLE={name='score_data'} model={name='fpca_model'} OUTPUT={casout={name='fpca_scores', replace=true}}; |
| 4 | |
| 5 | RUN; |
| 6 |
Score data specifying an ID variable and limiting the output to the first 2 principal components.
| 1 | |
| 2 | PROC CAS; |
| 3 | fpca.fPcaScore / TABLE={name='score_data'} model={name='fpca_model'} id={'id'} OUTPUT={casout={name='fpca_scores_limited', replace=true}, npc=2}; |
| 4 | |
| 5 | RUN; |
| 6 |