EVRISCRIPT Module and File:Ga fitvsvarsfcm.png: Difference between pages

From Eigenvector Research Documentation Wiki
(Difference between pages)
Jump to navigation Jump to search
imported>Scott
No edit summary
 
(Maintenance script uploaded File:Ga fitvsvarsfcm.png)
 
Line 1: Line 1:
===Purpose===


EVRISCRIPT_Module objects wrap Eigenvector code and objects into "steps" used in an [[Evriscript]] Object. Each step defines the operation, inputs, outputs, and options.
[[EVRISCRIPT_Module]]) to perform.
===Description===
====Creating a modules====
Create an empty instance of a module:
module = evriscript_module;
After creating instance of evriscript_module, the following operations can be done to customize the module for its particular operation.
====Using Keywords====
Specify the keyword to instance the module through evriscript objects:
module.keyword = 'knn';
====Description====
Provide a description of the module:
module.description = 'KNN K-nearest neighbor classifier';
====Module Modes====
For any particular module you can add modes to define operations in the step. For example, a module for calculating a PLS model would include "calibrate", "apply", and "test" modes. An example to create a "calibrate" mode for KNN:
module.command.calibrate = 'var.model = knn(var.x,var.k,options);';
* Creating a new mode starts by defining the "command" property for the mode. This consists of specifying the command property, followed by the mode name ("calibrate" in the example above) and the command to execute for this mode. The mode name is also used to specify mode-specific settings in the "required", "optional" and "outputs" properties of the EVRISCRIPT_MODULE object.
* Note that inputs and outputs from the function are prefixed with "var." to indicate these are properties on the evriscript object (see "required" and "optional" properties below). The "options" input never has a var. prefix as it refers to the EVRISCRIPT_STEP options specifically.
* Any number of modes can be defined for a given module. If only one is defined, this will be the default mode when the given module is added to a script. Otherwise, the default mode will be empty and the user will be forced to choose a mode before the script step containing this module is run.
====Required Inputs====
This cell array indicates what inputs MUST be defined prior to executing the module in this mode.
module.required.calibrate = {'x'};
====Optional Inputs====
Define the list of optional inputs for the mode:
module.optional.calibrate = {'k'};
This cell array indicates what inputs can be left undefined prior to executing the module in this mode. An optional input, if not defined by the caller, is passed with the value defined in the "default" field (see below). Options are always considered "optional" and need not be listed. The options listed in the "options" field will be passed for these values.
====Default Values====
Defining default values for optional inputs:
module.default.k = 3;
Provide values which are used if the given optional input is not provided by the user. If no inputs are optional, this field will be empty. Note that the default is the same for all modes (this field is not indexed by the mode name.)
====Outputs====
Define the list of outputs expected from the mode:
module.outputs.calibrate  = {'model'};
This cell array indicates the outputs expected. Outputs will be mapped to properties of the evriscript object and, unless listed as a required or optional input for this mode, will be marked as "read only".
====Options====
Define the options:
module.options = knn('options');
Provides a sub-structure which will contain the default options for this function. Only one set of default options can be provided and that will be used for all modes. If different modes of calling this module require different options, then separate modules must be created.
====Renaming====
To rename a mode:
module = rename(module,'onecall','mycall')
Renames the mode 'onecall' to be 'mycall'.
====Locking====
To lock a module:
module.lock = 1
Forces the module into "read-only" mode indicating that no additional changes can be made to the object.
===Examples===
module = evriscript_module %empty module
module = evriscript_module('pls') %return module for this keyword predefined for PLS model
===See Also===
[[EVRISCRIPT]]

Latest revision as of 11:44, 1 August 2019