Evriscript

From Eigenvector Research Documentation Wiki
Revision as of 15:50, 16 November 2010 by imported>Donal
Jump to navigation Jump to search

Purpose

EVRISCRIPT objects allow calling various PLS_Toolbox operations in an object-oriented way. A script can contain one or more steps, each of which is a separate object with its own inputs and outputs. Each step is defined by a keyword which represents the type of step (known as a module) to perform.

Description

Creating a script

Call evriscript with parameters indicating the sequence of steps to perform, each step indicated by its keyword. The list of available step keywords is given by the command: evriscript_module('showall')

  myscript = evriscript(keyword,keyword,...);  % create a script with two or more steps

Example, myscript = evriscript( 'pls', 'crossval', 'choosecomp', 'pls'); creates an evriscript named 'myscript'. The script steps are evriscript_step objects which can be accessed by indexing, 'myscript(1)', for example.

The individual steps' properties are then configured. Most steps have more than one 'step_mode', for example 'calibrate', 'apply' or 'test'. You can see which step_modes are avaialable for a step by entering myscript(1).step_module. This also shows the required and optional properties associated with the step for each step_mode. The 'calibrate' step_mode lists required properties as: 'x', 'y', and 'ncomp'.

Assigning step properties

script(step).property = value

where "step" is the step number to modify and "property" is the property to assign with the given value. Example:

myscript(1).step_mode              = 'calibrate';
myscript(1).options.display        = 'on';
myscript(1).options.plots          = 'none';
myscript(1).options.preprocessing  = {'autoscale'};
myscript(1).x                      = xblock1;
myscript(1).y                      = yblock1;
myscript(1).ncomp                  = ncomp;

Note, that assigned variables must exist in the workspace, xblock1, yblock1, ncomp, for example.

Defining step mode: Some step modules can operate in different "modes" and the desired mode must be selected prior to script exection. Typically, modes define different required inputs and provided outputs. The specifics of the inputs and outputs are defined on the help page for the given module (this is the same as the function help page). Examples are the "calibrate", "test", and "apply" modes of the PCA, PLS, and other modeling functions. To define the mode for a given step, assign the "step_mode" property of the given script step. Example:

script(1).step_mode = 'calibrate'

assign step one's mode to be "calibrate". Note that if a given module has only one mode it can operate in, that mode is automatically selected. Otherwise, the user must choose among the modes available.