Matlab routines



This is a list of the main routines you can use to build classification and regression models by means of the Reshaped Sequential Replacement (RSR) toolbox for MATLAB:

START_RSR

START_RSR opens a pseudo graphical interface for selecting data, setting the options and launching the calculation as explained in How to use the toolbox. There are no inputs; data can be loaded and saved directly from the graphical interface.

[-> top]


Creating options

Options can be created with the rsr_options function or following the steps of START_RSR (see How to use the toolbox).

[-> top]


Routines for fitting models

Ordinary Least Squares (OLS), Principal Component (PCR) regression and K-Nearest Neighbors (kNN) can be fitted by means of the routines olsfit, pcrfit and knnfit, respectively. The output of the rountines collects the calculated response (or class) vector [samples x 1], the statistical parameters in fitting, and other details. Type "help routine_name" on the MATLAB command window for further information.

[-> top]


Routines for cross validation

Cross-validation of Ordinary Least Squares (OLS), Principal Component (PCR) regression and K-Nearest Neighbors (kNN) can be calculated by means of the routines olscv, pcrcv and knncv, respectively. The output of the rountines collects the predicted class vector [samples x 1], the statistical parameters in cross validation, and other details. Cross validation is performed with venetian blinds (e.g. with 3 cv groups the split of the first group will be [1,0,0,1,0,0,....,1,0,0] and so on) or contiguous blocks (e.g. the split of the first group will be [1,1,1,1,0,0,....,0,0,0] and so on). Type "help routine_name" on the MATLAB command window for further information.

[-> top]


Routines for optimising models

The cross validation procedure for selecting the optimal components for PCR and the optimal number of neighbours (k) for K-Nearest Neighbors (kNN) can be performed with the routines pcrcompsel and knnksel, respectively. The output of the rountines collects the statistical parameters in cross validation associated to each component/k value. Type "help routine_name" on the MATLAB command window for further information.

[-> top]


Routines for predicting new samples

Prediction of new samples by means of Ordinary Least Squares (OLS), Principal Component (PCR) regression and K-Nearest Neighbors (kNN) can be performed with the routines olstest, pcrtest and knnpred, respectively. The output of the rountines collects the predicted class vector [samples x 1] and other details. Type "help routine_name" on the MATLAB command window for further informations.
Additionally, predictions can be made by means of the models in the final population by means of the rsr_make_predictions function, as explained in Making predictions.

[-> top]