fpca

fPcaScore

Description

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.

Settings
ParameterDescription
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.
Data Preparation View data prep sheet
Data Creation for Scoring

Create a CAS table with functional data for scoring. Note: This example assumes an FPCA model table named 'fpca_model' already exists.

Copied!
1 
2DATA casuser.score_data;
3DO id=1 to 50;
4DO time=1 to 20;
5value=sin(time/5) + rannor(1)*0.1;
6OUTPUT;
7END;
8END;
9 
10RUN;
11 

Examples

Score the input data using the trained model and save results.

SAS® / CAS Code Code awaiting community validation
Copied!
1 
2PROC CAS;
3fpca.fPcaScore / TABLE={name='score_data'} model={name='fpca_model'} OUTPUT={casout={name='fpca_scores', replace=true}};
4 
5RUN;
6 
Result :
A CAS table named 'fpca_scores' is created containing the scores for the functional data.

Score data specifying an ID variable and limiting the output to the first 2 principal components.

SAS® / CAS Code Code awaiting community validation
Copied!
1 
2PROC CAS;
3fpca.fPcaScore / TABLE={name='score_data'} model={name='fpca_model'} id={'id'} OUTPUT={casout={name='fpca_scores_limited', replace=true}, npc=2};
4 
5RUN;
6 
Result :
A CAS table named 'fpca_scores_limited' containing scores for only the first 2 principal components, indexed by the 'id' variable.

FAQ

What is the primary function of the fPcaScore action?
Which parameter is required to define the trained model used for scoring?
How can you control the number of principal components used during scoring?
What does the "casout" parameter do?
Is the "table" parameter mandatory for the fPcaScore action?