EVRISCRIPT Module: Difference between revisions
Jump to navigation
Jump to search
imported>Scott (Created page with "===Purpose=== EVRISCRIPT_Module objects wrap Eigenvector code and objects into "steps" used in an Evriscript Object. Each step defines the operation, inputs, outputs, and...") |
imported>Scott No edit summary |
||
Line 18: | Line 18: | ||
module.description = 'KNN K-nearest neighbor classifier'; | module.description = 'KNN K-nearest neighbor classifier'; | ||
====Add New Mode==== | ====Add New Mode==== | ||
* | * 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. Below a "calibrate" mode for KNN is created: | ||
module.command.calibrate = 'var.model = knn(var.x,var.k,options);'; | 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. | : 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. | : 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. | |||
Revision as of 14:45, 3 March 2016
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';
Add Description
- Provide a description of the module:
module.description = 'KNN K-nearest neighbor classifier';
Add New Mode
- 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. Below a "calibrate" mode for KNN is created:
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.