The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....


Unit: SDL_statis
Class: TPLSModel
Declaration: function LoadModelCoefficients (FileName: string; var Comment: string): integer;

The methods LoadModelCoefficients loads the PLS model parameters which have previously been stored by the method SaveModelCoefficients from the file FileName.

The function returns the following error codes:

0 The model has been successfully loaded.
-1 The specified file has not been found.
-2 The PLS model ID is invalid.
-3 The file structure of the model data is invalid.

After successfully loading the model the variable parameter Comment returns the user defined comment. Further, the following properties are adjusted in their sizes and are filled with the model information:
Factors The number of factors used for creating the model (1)
NamePredictor, NameResponse The names of the predictor and response variables
XMat, YMat These matrices are changed to four rows containing the
minimum, the maximum, the mean and the standard
deviation of the corresponding variables of the training set.
RegCoeff The regression coefficients computed during the training
of the model.

Hint: Please keep in mind that LoadModelCoefficients destroys the data in the above mentioned properties. Thus, data for new training runs have to be freshly filled in. In order to avoid any unexpected interferences we recommend to strictly separate the training and the application of PLS models by using two different instances of the TPLSModel class.

(1) The number of factors is only stored in releases of the SDL Suite higher than 10.0. Thus, old models which have been created by release 10.0 will return a zero value for the number of factors.

Last Update: 2023-Feb-06